From dd7e59a4956efef291e17295ba08841e9d74e505 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Nov 2025 13:25:01 +0800 Subject: [PATCH 01/57] chore(deps): update dependency rollup to v4.53.3 (#14519) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- packages/api/package.json | 2 +- pnpm-lock.yaml | 206 +++++++++++++++++++------------------- 2 files changed, 104 insertions(+), 104 deletions(-) diff --git a/packages/api/package.json b/packages/api/package.json index 0aa4d6c5b..57628957b 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -55,7 +55,7 @@ "eslint-plugin-security": "3.0.1", "fast-glob": "3.3.3", "globals": "^16.2.0", - "rollup": "4.53.2", + "rollup": "4.53.3", "tslib": "^2.8.1", "typescript": "^5.8.3", "typescript-eslint": "^8.34.1" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4e94cee94..c0f85ced8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -63,10 +63,10 @@ importers: version: 9.29.0 '@rollup/plugin-terser': specifier: 0.4.4 - version: 0.4.4(rollup@4.53.2) + version: 0.4.4(rollup@4.53.3) '@rollup/plugin-typescript': specifier: 12.3.0 - version: 12.3.0(rollup@4.53.2)(tslib@2.8.1)(typescript@5.8.3) + version: 12.3.0(rollup@4.53.3)(tslib@2.8.1)(typescript@5.8.3) '@types/eslint': specifier: ^9.6.1 version: 9.6.1 @@ -89,8 +89,8 @@ importers: specifier: ^16.2.0 version: 16.2.0 rollup: - specifier: 4.53.2 - version: 4.53.2 + specifier: 4.53.3 + version: 4.53.3 tslib: specifier: ^2.8.1 version: 2.8.1 @@ -1125,113 +1125,113 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.53.2': - resolution: {integrity: sha512-yDPzwsgiFO26RJA4nZo8I+xqzh7sJTZIWQOxn+/XOdPE31lAvLIYCKqjV+lNH/vxE2L2iH3plKxDCRK6i+CwhA==} + '@rollup/rollup-android-arm-eabi@4.53.3': + resolution: {integrity: sha512-mRSi+4cBjrRLoaal2PnqH82Wqyb+d3HsPUN/W+WslCXsZsyHa9ZeQQX/pQsZaVIWDkPcpV6jJ+3KLbTbgnwv8w==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.53.2': - resolution: {integrity: sha512-k8FontTxIE7b0/OGKeSN5B6j25EuppBcWM33Z19JoVT7UTXFSo3D9CdU39wGTeb29NO3XxpMNauh09B+Ibw+9g==} + '@rollup/rollup-android-arm64@4.53.3': + resolution: {integrity: sha512-CbDGaMpdE9sh7sCmTrTUyllhrg65t6SwhjlMJsLr+J8YjFuPmCEjbBSx4Z/e4SmDyH3aB5hGaJUP2ltV/vcs4w==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.53.2': - resolution: {integrity: sha512-A6s4gJpomNBtJ2yioj8bflM2oogDwzUiMl2yNJ2v9E7++sHrSrsQ29fOfn5DM/iCzpWcebNYEdXpaK4tr2RhfQ==} + '@rollup/rollup-darwin-arm64@4.53.3': + resolution: {integrity: sha512-Nr7SlQeqIBpOV6BHHGZgYBuSdanCXuw09hon14MGOLGmXAFYjx1wNvquVPmpZnl0tLjg25dEdr4IQ6GgyToCUA==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.53.2': - resolution: {integrity: sha512-e6XqVmXlHrBlG56obu9gDRPW3O3hLxpwHpLsBJvuI8qqnsrtSZ9ERoWUXtPOkY8c78WghyPHZdmPhHLWNdAGEw==} + '@rollup/rollup-darwin-x64@4.53.3': + resolution: {integrity: sha512-DZ8N4CSNfl965CmPktJ8oBnfYr3F8dTTNBQkRlffnUarJ2ohudQD17sZBa097J8xhQ26AwhHJ5mvUyQW8ddTsQ==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.53.2': - resolution: {integrity: sha512-v0E9lJW8VsrwPux5Qe5CwmH/CF/2mQs6xU1MF3nmUxmZUCHazCjLgYvToOk+YuuUqLQBio1qkkREhxhc656ViA==} + '@rollup/rollup-freebsd-arm64@4.53.3': + resolution: {integrity: sha512-yMTrCrK92aGyi7GuDNtGn2sNW+Gdb4vErx4t3Gv/Tr+1zRb8ax4z8GWVRfr3Jw8zJWvpGHNpss3vVlbF58DZ4w==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.53.2': - resolution: {integrity: sha512-ClAmAPx3ZCHtp6ysl4XEhWU69GUB1D+s7G9YjHGhIGCSrsg00nEGRRZHmINYxkdoJehde8VIsDC5t9C0gb6yqA==} + '@rollup/rollup-freebsd-x64@4.53.3': + resolution: {integrity: sha512-lMfF8X7QhdQzseM6XaX0vbno2m3hlyZFhwcndRMw8fbAGUGL3WFMBdK0hbUBIUYcEcMhVLr1SIamDeuLBnXS+Q==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.53.2': - resolution: {integrity: sha512-EPlb95nUsz6Dd9Qy13fI5kUPXNSljaG9FiJ4YUGU1O/Q77i5DYFW5KR8g1OzTcdZUqQQ1KdDqsTohdFVwCwjqg==} + '@rollup/rollup-linux-arm-gnueabihf@4.53.3': + resolution: {integrity: sha512-k9oD15soC/Ln6d2Wv/JOFPzZXIAIFLp6B+i14KhxAfnq76ajt0EhYc5YPeX6W1xJkAdItcVT+JhKl1QZh44/qw==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.53.2': - resolution: {integrity: sha512-BOmnVW+khAUX+YZvNfa0tGTEMVVEerOxN0pDk2E6N6DsEIa2Ctj48FOMfNDdrwinocKaC7YXUZ1pHlKpnkja/Q==} + '@rollup/rollup-linux-arm-musleabihf@4.53.3': + resolution: {integrity: sha512-vTNlKq+N6CK/8UktsrFuc+/7NlEYVxgaEgRXVUVK258Z5ymho29skzW1sutgYjqNnquGwVUObAaxae8rZ6YMhg==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.53.2': - resolution: {integrity: sha512-Xt2byDZ+6OVNuREgBXr4+CZDJtrVso5woFtpKdGPhpTPHcNG7D8YXeQzpNbFRxzTVqJf7kvPMCub/pcGUWgBjA==} + '@rollup/rollup-linux-arm64-gnu@4.53.3': + resolution: {integrity: sha512-RGrFLWgMhSxRs/EWJMIFM1O5Mzuz3Xy3/mnxJp/5cVhZ2XoCAxJnmNsEyeMJtpK+wu0FJFWz+QF4mjCA7AUQ3w==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.53.2': - resolution: {integrity: sha512-+LdZSldy/I9N8+klim/Y1HsKbJ3BbInHav5qE9Iy77dtHC/pibw1SR/fXlWyAk0ThnpRKoODwnAuSjqxFRDHUQ==} + '@rollup/rollup-linux-arm64-musl@4.53.3': + resolution: {integrity: sha512-kASyvfBEWYPEwe0Qv4nfu6pNkITLTb32p4yTgzFCocHnJLAHs+9LjUu9ONIhvfT/5lv4YS5muBHyuV84epBo/A==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-loong64-gnu@4.53.2': - resolution: {integrity: sha512-8ms8sjmyc1jWJS6WdNSA23rEfdjWB30LH8Wqj0Cqvv7qSHnvw6kgMMXRdop6hkmGPlyYBdRPkjJnj3KCUHV/uQ==} + '@rollup/rollup-linux-loong64-gnu@4.53.3': + resolution: {integrity: sha512-JiuKcp2teLJwQ7vkJ95EwESWkNRFJD7TQgYmCnrPtlu50b4XvT5MOmurWNrCj3IFdyjBQ5p9vnrX4JM6I8OE7g==} cpu: [loong64] os: [linux] - '@rollup/rollup-linux-ppc64-gnu@4.53.2': - resolution: {integrity: sha512-3HRQLUQbpBDMmzoxPJYd3W6vrVHOo2cVW8RUo87Xz0JPJcBLBr5kZ1pGcQAhdZgX9VV7NbGNipah1omKKe23/g==} + '@rollup/rollup-linux-ppc64-gnu@4.53.3': + resolution: {integrity: sha512-EoGSa8nd6d3T7zLuqdojxC20oBfNT8nexBbB/rkxgKj5T5vhpAQKKnD+h3UkoMuTyXkP5jTjK/ccNRmQrPNDuw==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.53.2': - resolution: {integrity: sha512-fMjKi+ojnmIvhk34gZP94vjogXNNUKMEYs+EDaB/5TG/wUkoeua7p7VCHnE6T2Tx+iaghAqQX8teQzcvrYpaQA==} + '@rollup/rollup-linux-riscv64-gnu@4.53.3': + resolution: {integrity: sha512-4s+Wped2IHXHPnAEbIB0YWBv7SDohqxobiiPA1FIWZpX+w9o2i4LezzH/NkFUl8LRci/8udci6cLq+jJQlh+0g==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-riscv64-musl@4.53.2': - resolution: {integrity: sha512-XuGFGU+VwUUV5kLvoAdi0Wz5Xbh2SrjIxCtZj6Wq8MDp4bflb/+ThZsVxokM7n0pcbkEr2h5/pzqzDYI7cCgLQ==} + '@rollup/rollup-linux-riscv64-musl@4.53.3': + resolution: {integrity: sha512-68k2g7+0vs2u9CxDt5ktXTngsxOQkSEV/xBbwlqYcUrAVh6P9EgMZvFsnHy4SEiUl46Xf0IObWVbMvPrr2gw8A==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.53.2': - resolution: {integrity: sha512-w6yjZF0P+NGzWR3AXWX9zc0DNEGdtvykB03uhonSHMRa+oWA6novflo2WaJr6JZakG2ucsyb+rvhrKac6NIy+w==} + '@rollup/rollup-linux-s390x-gnu@4.53.3': + resolution: {integrity: sha512-VYsFMpULAz87ZW6BVYw3I6sWesGpsP9OPcyKe8ofdg9LHxSbRMd7zrVrr5xi/3kMZtpWL/wC+UIJWJYVX5uTKg==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.53.2': - resolution: {integrity: sha512-yo8d6tdfdeBArzC7T/PnHd7OypfI9cbuZzPnzLJIyKYFhAQ8SvlkKtKBMbXDxe1h03Rcr7u++nFS7tqXz87Gtw==} + '@rollup/rollup-linux-x64-gnu@4.53.3': + resolution: {integrity: sha512-3EhFi1FU6YL8HTUJZ51imGJWEX//ajQPfqWLI3BQq4TlvHy4X0MOr5q3D2Zof/ka0d5FNdPwZXm3Yyib/UEd+w==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.53.2': - resolution: {integrity: sha512-ah59c1YkCxKExPP8O9PwOvs+XRLKwh/mV+3YdKqQ5AMQ0r4M4ZDuOrpWkUaqO7fzAHdINzV9tEVu8vNw48z0lA==} + '@rollup/rollup-linux-x64-musl@4.53.3': + resolution: {integrity: sha512-eoROhjcc6HbZCJr+tvVT8X4fW3/5g/WkGvvmwz/88sDtSJzO7r/blvoBDgISDiCjDRZmHpwud7h+6Q9JxFwq1Q==} cpu: [x64] os: [linux] - '@rollup/rollup-openharmony-arm64@4.53.2': - resolution: {integrity: sha512-4VEd19Wmhr+Zy7hbUsFZ6YXEiP48hE//KPLCSVNY5RMGX2/7HZ+QkN55a3atM1C/BZCGIgqN+xrVgtdak2S9+A==} + '@rollup/rollup-openharmony-arm64@4.53.3': + resolution: {integrity: sha512-OueLAWgrNSPGAdUdIjSWXw+u/02BRTcnfw9PN41D2vq/JSEPnJnVuBgw18VkN8wcd4fjUs+jFHVM4t9+kBSNLw==} cpu: [arm64] os: [openharmony] - '@rollup/rollup-win32-arm64-msvc@4.53.2': - resolution: {integrity: sha512-IlbHFYc/pQCgew/d5fslcy1KEaYVCJ44G8pajugd8VoOEI8ODhtb/j8XMhLpwHCMB3yk2J07ctup10gpw2nyMA==} + '@rollup/rollup-win32-arm64-msvc@4.53.3': + resolution: {integrity: sha512-GOFuKpsxR/whszbF/bzydebLiXIHSgsEUp6M0JI8dWvi+fFa1TD6YQa4aSZHtpmh2/uAlj/Dy+nmby3TJ3pkTw==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.53.2': - resolution: {integrity: sha512-lNlPEGgdUfSzdCWU176ku/dQRnA7W+Gp8d+cWv73jYrb8uT7HTVVxq62DUYxjbaByuf1Yk0RIIAbDzp+CnOTFg==} + '@rollup/rollup-win32-ia32-msvc@4.53.3': + resolution: {integrity: sha512-iah+THLcBJdpfZ1TstDFbKNznlzoxa8fmnFYK4V67HvmuNYkVdAywJSoteUszvBQ9/HqN2+9AZghbajMsFT+oA==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-gnu@4.53.2': - resolution: {integrity: sha512-S6YojNVrHybQis2lYov1sd+uj7K0Q05NxHcGktuMMdIQ2VixGwAfbJ23NnlvvVV1bdpR2m5MsNBViHJKcA4ADw==} + '@rollup/rollup-win32-x64-gnu@4.53.3': + resolution: {integrity: sha512-J9QDiOIZlZLdcot5NXEepDkstocktoVjkaKUtqzgzpt2yWjGlbYiKyp05rWwk4nypbYUNoFAztEgixoLaSETkg==} cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.53.2': - resolution: {integrity: sha512-k+/Rkcyx//P6fetPoLMb8pBeqJBNGx81uuf7iljX9++yNBVRDQgD04L+SVXmXmh5ZP4/WOp4mWF0kmi06PW2tA==} + '@rollup/rollup-win32-x64-msvc@4.53.3': + resolution: {integrity: sha512-UhTd8u31dXadv0MopwGgNOBpUVROFKWVQgAg5N1ESyCz8AuBcMqm4AuTjrwgQKGDfoFuz02EuMRHQIw/frmYKQ==} cpu: [x64] os: [win32] @@ -2151,8 +2151,8 @@ packages: resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - rollup@4.53.2: - resolution: {integrity: sha512-MHngMYwGJVi6Fmnk6ISmnk7JAHRNF0UkuucA0CUW3N3a4KnONPEZz+vUanQP/ZC/iY1Qkf3bwPWzyY84wEks1g==} + rollup@4.53.3: + resolution: {integrity: sha512-w8GmOxZfBmKknvdXU1sdM9NHcoQejwF/4mNgj2JuEEdRaHwwF12K7e9eXn1nLZ07ad+du76mkVsyeb2rKGllsA==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -3290,95 +3290,95 @@ snapshots: dependencies: quansync: 0.2.10 - '@rollup/plugin-terser@0.4.4(rollup@4.53.2)': + '@rollup/plugin-terser@0.4.4(rollup@4.53.3)': dependencies: serialize-javascript: 6.0.2 smob: 1.5.0 terser: 5.43.1 optionalDependencies: - rollup: 4.53.2 + rollup: 4.53.3 - '@rollup/plugin-typescript@12.3.0(rollup@4.53.2)(tslib@2.8.1)(typescript@5.8.3)': + '@rollup/plugin-typescript@12.3.0(rollup@4.53.3)(tslib@2.8.1)(typescript@5.8.3)': dependencies: - '@rollup/pluginutils': 5.2.0(rollup@4.53.2) + '@rollup/pluginutils': 5.2.0(rollup@4.53.3) resolve: 1.22.10 typescript: 5.8.3 optionalDependencies: - rollup: 4.53.2 + rollup: 4.53.3 tslib: 2.8.1 - '@rollup/pluginutils@5.2.0(rollup@4.53.2)': + '@rollup/pluginutils@5.2.0(rollup@4.53.3)': dependencies: '@types/estree': 1.0.8 estree-walker: 2.0.2 picomatch: 4.0.3 optionalDependencies: - rollup: 4.53.2 + rollup: 4.53.3 - '@rollup/rollup-android-arm-eabi@4.53.2': + '@rollup/rollup-android-arm-eabi@4.53.3': optional: true - '@rollup/rollup-android-arm64@4.53.2': + '@rollup/rollup-android-arm64@4.53.3': optional: true - '@rollup/rollup-darwin-arm64@4.53.2': + '@rollup/rollup-darwin-arm64@4.53.3': optional: true - '@rollup/rollup-darwin-x64@4.53.2': + '@rollup/rollup-darwin-x64@4.53.3': optional: true - '@rollup/rollup-freebsd-arm64@4.53.2': + '@rollup/rollup-freebsd-arm64@4.53.3': optional: true - '@rollup/rollup-freebsd-x64@4.53.2': + '@rollup/rollup-freebsd-x64@4.53.3': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.53.2': + '@rollup/rollup-linux-arm-gnueabihf@4.53.3': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.53.2': + '@rollup/rollup-linux-arm-musleabihf@4.53.3': optional: true - '@rollup/rollup-linux-arm64-gnu@4.53.2': + '@rollup/rollup-linux-arm64-gnu@4.53.3': optional: true - '@rollup/rollup-linux-arm64-musl@4.53.2': + '@rollup/rollup-linux-arm64-musl@4.53.3': optional: true - '@rollup/rollup-linux-loong64-gnu@4.53.2': + '@rollup/rollup-linux-loong64-gnu@4.53.3': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.53.2': + '@rollup/rollup-linux-ppc64-gnu@4.53.3': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.53.2': + '@rollup/rollup-linux-riscv64-gnu@4.53.3': optional: true - '@rollup/rollup-linux-riscv64-musl@4.53.2': + '@rollup/rollup-linux-riscv64-musl@4.53.3': optional: true - '@rollup/rollup-linux-s390x-gnu@4.53.2': + '@rollup/rollup-linux-s390x-gnu@4.53.3': optional: true - '@rollup/rollup-linux-x64-gnu@4.53.2': + '@rollup/rollup-linux-x64-gnu@4.53.3': optional: true - '@rollup/rollup-linux-x64-musl@4.53.2': + '@rollup/rollup-linux-x64-musl@4.53.3': optional: true - '@rollup/rollup-openharmony-arm64@4.53.2': + '@rollup/rollup-openharmony-arm64@4.53.3': optional: true - '@rollup/rollup-win32-arm64-msvc@4.53.2': + '@rollup/rollup-win32-arm64-msvc@4.53.3': optional: true - '@rollup/rollup-win32-ia32-msvc@4.53.2': + '@rollup/rollup-win32-ia32-msvc@4.53.3': optional: true - '@rollup/rollup-win32-x64-gnu@4.53.2': + '@rollup/rollup-win32-x64-gnu@4.53.3': optional: true - '@rollup/rollup-win32-x64-msvc@4.53.2': + '@rollup/rollup-win32-x64-msvc@4.53.3': optional: true '@standard-schema/spec@1.0.0': {} @@ -4385,32 +4385,32 @@ snapshots: reusify@1.1.0: {} - rollup@4.53.2: + rollup@4.53.3: dependencies: '@types/estree': 1.0.8 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.53.2 - '@rollup/rollup-android-arm64': 4.53.2 - '@rollup/rollup-darwin-arm64': 4.53.2 - '@rollup/rollup-darwin-x64': 4.53.2 - '@rollup/rollup-freebsd-arm64': 4.53.2 - '@rollup/rollup-freebsd-x64': 4.53.2 - '@rollup/rollup-linux-arm-gnueabihf': 4.53.2 - '@rollup/rollup-linux-arm-musleabihf': 4.53.2 - '@rollup/rollup-linux-arm64-gnu': 4.53.2 - '@rollup/rollup-linux-arm64-musl': 4.53.2 - '@rollup/rollup-linux-loong64-gnu': 4.53.2 - '@rollup/rollup-linux-ppc64-gnu': 4.53.2 - '@rollup/rollup-linux-riscv64-gnu': 4.53.2 - '@rollup/rollup-linux-riscv64-musl': 4.53.2 - '@rollup/rollup-linux-s390x-gnu': 4.53.2 - '@rollup/rollup-linux-x64-gnu': 4.53.2 - '@rollup/rollup-linux-x64-musl': 4.53.2 - '@rollup/rollup-openharmony-arm64': 4.53.2 - '@rollup/rollup-win32-arm64-msvc': 4.53.2 - '@rollup/rollup-win32-ia32-msvc': 4.53.2 - '@rollup/rollup-win32-x64-gnu': 4.53.2 - '@rollup/rollup-win32-x64-msvc': 4.53.2 + '@rollup/rollup-android-arm-eabi': 4.53.3 + '@rollup/rollup-android-arm64': 4.53.3 + '@rollup/rollup-darwin-arm64': 4.53.3 + '@rollup/rollup-darwin-x64': 4.53.3 + '@rollup/rollup-freebsd-arm64': 4.53.3 + '@rollup/rollup-freebsd-x64': 4.53.3 + '@rollup/rollup-linux-arm-gnueabihf': 4.53.3 + '@rollup/rollup-linux-arm-musleabihf': 4.53.3 + '@rollup/rollup-linux-arm64-gnu': 4.53.3 + '@rollup/rollup-linux-arm64-musl': 4.53.3 + '@rollup/rollup-linux-loong64-gnu': 4.53.3 + '@rollup/rollup-linux-ppc64-gnu': 4.53.3 + '@rollup/rollup-linux-riscv64-gnu': 4.53.3 + '@rollup/rollup-linux-riscv64-musl': 4.53.3 + '@rollup/rollup-linux-s390x-gnu': 4.53.3 + '@rollup/rollup-linux-x64-gnu': 4.53.3 + '@rollup/rollup-linux-x64-musl': 4.53.3 + '@rollup/rollup-openharmony-arm64': 4.53.3 + '@rollup/rollup-win32-arm64-msvc': 4.53.3 + '@rollup/rollup-win32-ia32-msvc': 4.53.3 + '@rollup/rollup-win32-x64-gnu': 4.53.3 + '@rollup/rollup-win32-x64-msvc': 4.53.3 fsevents: 2.3.3 run-parallel@1.2.0: @@ -4652,7 +4652,7 @@ snapshots: fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 postcss: 8.5.6 - rollup: 4.53.2 + rollup: 4.53.3 tinyglobby: 0.2.15 optionalDependencies: '@types/node': 24.10.0 From 1573c72402352949d1fd3ca5c6fdbee46fe69fbb Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Wed, 26 Nov 2025 11:22:45 +0100 Subject: [PATCH 02/57] fix: remove \\r from schema files on windows (#14561) --- .changes/schema-carriage-return.md | 5 +++++ crates/tauri-utils/src/acl/schema.rs | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 .changes/schema-carriage-return.md diff --git a/.changes/schema-carriage-return.md b/.changes/schema-carriage-return.md new file mode 100644 index 000000000..44bbf97d2 --- /dev/null +++ b/.changes/schema-carriage-return.md @@ -0,0 +1,5 @@ +--- +tauri-utils: patch:bug +--- + +Fixed an issue that caused schema files to have `\r` characters on Windows. diff --git a/crates/tauri-utils/src/acl/schema.rs b/crates/tauri-utils/src/acl/schema.rs index c1a793fc7..3bb7ecff5 100644 --- a/crates/tauri-utils/src/acl/schema.rs +++ b/crates/tauri-utils/src/acl/schema.rs @@ -317,6 +317,9 @@ pub fn generate_capability_schema( extend_permission_entry_schema(&mut schema, acl); let schema_str = serde_json::to_string_pretty(&schema).unwrap(); + // FIXME: in schemars@v1 this doesn't seem to be necessary anymore. If it is, find a better solution. + let schema_str = schema_str.replace("\\r\\n", "\\n"); + let out_dir = PathBuf::from(CAPABILITIES_SCHEMA_FOLDER_PATH); fs::create_dir_all(&out_dir)?; @@ -389,6 +392,9 @@ pub fn generate_permissions_schema>( let schema_str = serde_json::to_string_pretty(&schema)?; + // FIXME: in schemars@v1 this doesn't seem to be necessary anymore. If it is, find a better solution. + let schema_str = schema_str.replace("\\r\\n", "\\n"); + let out_dir = out_dir.as_ref().join(PERMISSION_SCHEMAS_FOLDER_NAME); fs::create_dir_all(&out_dir).map_err(|e| Error::CreateDir(e, out_dir.clone()))?; From f022b2d1ae57612e39c75782926f2f341d9034a8 Mon Sep 17 00:00:00 2001 From: hrzlgnm Date: Sun, 30 Nov 2025 04:45:43 +0100 Subject: [PATCH 03/57] fix(cli): Skip signing bundles entirely if `--no-sign` is requested (#14582) Closes #14581 --- .changes/fix-no-sign-option.md | 6 ++++++ crates/tauri-cli/src/bundle.rs | 5 +++++ 2 files changed, 11 insertions(+) create mode 100644 .changes/fix-no-sign-option.md diff --git a/.changes/fix-no-sign-option.md b/.changes/fix-no-sign-option.md new file mode 100644 index 000000000..71352c5ee --- /dev/null +++ b/.changes/fix-no-sign-option.md @@ -0,0 +1,6 @@ +--- +tauri-cli: patch:bug +--- + +Fixed an issue that caused the cli to error out with missing private key, in case the option `--no-sign` was requested and the `tauri.config` has signing key set and the plugin `tauri-plugin-updater` is used. + diff --git a/crates/tauri-cli/src/bundle.rs b/crates/tauri-cli/src/bundle.rs index e48aee197..890386cd7 100644 --- a/crates/tauri-cli/src/bundle.rs +++ b/crates/tauri-cli/src/bundle.rs @@ -249,6 +249,11 @@ fn sign_updaters( return Ok(()); } + if settings.no_sign() { + log::warn!("Updater signing is skipped due to --no-sign flag."); + return Ok(()); + } + // get the public key let pubkey = &update_settings.pubkey; // check if pubkey points to a file... From 1496145f8222649efeff22b819a96208670bbea1 Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Sun, 30 Nov 2025 07:49:33 +0100 Subject: [PATCH 04/57] fix(bundler): typo in 32bit arch (#14585) * fix(bundler): typo in 32bit arch * changefile --- .changes/appimage-32bit.md | 5 +++++ crates/tauri-bundler/src/bundle/linux/appimage/mod.rs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changes/appimage-32bit.md diff --git a/.changes/appimage-32bit.md b/.changes/appimage-32bit.md new file mode 100644 index 000000000..9c4437f29 --- /dev/null +++ b/.changes/appimage-32bit.md @@ -0,0 +1,5 @@ +--- +tauri-bundler: patch:bug +--- + +Fixed an issue that caused the AppImage bundler to fail with 404 errors for 32-bit builds. diff --git a/crates/tauri-bundler/src/bundle/linux/appimage/mod.rs b/crates/tauri-bundler/src/bundle/linux/appimage/mod.rs index 3a3b8bf47..29eb87bee 100644 --- a/crates/tauri-bundler/src/bundle/linux/appimage/mod.rs +++ b/crates/tauri-bundler/src/bundle/linux/appimage/mod.rs @@ -232,7 +232,7 @@ fn prepare_tools(tools_path: &Path, arch: &str, verbose: bool) -> crate::Result< write_and_make_executable(&apprun, &data)?; } - let linuxdeploy_arch = if arch == "i686" { "i383" } else { arch }; + let linuxdeploy_arch = if arch == "i686" { "i386" } else { arch }; let linuxdeploy = tools_path.join(format!("linuxdeploy-{linuxdeploy_arch}.AppImage")); if !linuxdeploy.exists() { let data = download(&format!("https://github.com/tauri-apps/binary-releases/releases/download/linuxdeploy/linuxdeploy-{linuxdeploy_arch}.AppImage"))?; From 4408f72af66c4827799c7fad80e9d9a73a4973a6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 30 Nov 2025 11:22:38 +0100 Subject: [PATCH 05/57] apply version updates (#14467) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../add-plugin-listener-error-handling.md | 5 ---- .changes/appimage-32bit.md | 5 ---- .changes/fix-needles-collect.md | 8 ------ .changes/fix-no-sign-option.md | 6 ---- .changes/nsis-3.11.md | 5 ---- .changes/perf-remove-needless-clone.md | 8 ------ .changes/pnpm-package-version-check.md | 6 ---- .changes/schema-carriage-return.md | 5 ---- .changes/version-req-error.md | 5 ---- Cargo.lock | 28 +++++++++---------- crates/tauri-build/CHANGELOG.md | 7 +++++ crates/tauri-build/Cargo.toml | 6 ++-- crates/tauri-bundler/CHANGELOG.md | 17 +++++++++++ crates/tauri-bundler/Cargo.toml | 6 ++-- crates/tauri-cli/CHANGELOG.md | 19 +++++++++++++ crates/tauri-cli/Cargo.toml | 8 +++--- crates/tauri-cli/config.schema.json | 2 +- crates/tauri-cli/metadata-v2.json | 8 +++--- crates/tauri-codegen/CHANGELOG.md | 6 ++++ crates/tauri-codegen/Cargo.toml | 4 +-- crates/tauri-macos-sign/CHANGELOG.md | 6 ++++ crates/tauri-macos-sign/Cargo.toml | 2 +- crates/tauri-macros/CHANGELOG.md | 7 +++++ crates/tauri-macros/Cargo.toml | 6 ++-- crates/tauri-plugin/CHANGELOG.md | 6 ++++ crates/tauri-plugin/Cargo.toml | 4 +-- crates/tauri-runtime-wry/CHANGELOG.md | 7 +++++ crates/tauri-runtime-wry/Cargo.toml | 6 ++-- crates/tauri-runtime/CHANGELOG.md | 6 ++++ crates/tauri-runtime/Cargo.toml | 4 +-- .../schemas/config.schema.json | 2 +- crates/tauri-utils/CHANGELOG.md | 6 ++++ crates/tauri-utils/Cargo.toml | 2 +- crates/tauri/CHANGELOG.md | 15 ++++++++++ crates/tauri/Cargo.toml | 14 +++++----- packages/api/CHANGELOG.md | 6 ++++ packages/api/package.json | 2 +- packages/cli/CHANGELOG.md | 14 ++++++++++ packages/cli/package.json | 2 +- 39 files changed, 175 insertions(+), 106 deletions(-) delete mode 100644 .changes/add-plugin-listener-error-handling.md delete mode 100644 .changes/appimage-32bit.md delete mode 100644 .changes/fix-needles-collect.md delete mode 100644 .changes/fix-no-sign-option.md delete mode 100644 .changes/nsis-3.11.md delete mode 100644 .changes/perf-remove-needless-clone.md delete mode 100644 .changes/pnpm-package-version-check.md delete mode 100644 .changes/schema-carriage-return.md delete mode 100644 .changes/version-req-error.md diff --git a/.changes/add-plugin-listener-error-handling.md b/.changes/add-plugin-listener-error-handling.md deleted file mode 100644 index 38474f02a..000000000 --- a/.changes/add-plugin-listener-error-handling.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@tauri-apps/api": patch:bug ---- - -Fix `addPluginListener` fallback added in https://github.com/tauri-apps/tauri/pull/14132 didn't work properly diff --git a/.changes/appimage-32bit.md b/.changes/appimage-32bit.md deleted file mode 100644 index 9c4437f29..000000000 --- a/.changes/appimage-32bit.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -tauri-bundler: patch:bug ---- - -Fixed an issue that caused the AppImage bundler to fail with 404 errors for 32-bit builds. diff --git a/.changes/fix-needles-collect.md b/.changes/fix-needles-collect.md deleted file mode 100644 index f7ffa30f9..000000000 --- a/.changes/fix-needles-collect.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"tauri": patch:perf -"tauri-cli": patch:perf -"tauri-bundler": patch:perf -"@tauri-apps/cli": patch:perf ---- - -refactor: remove needless collect. No user facing changes. diff --git a/.changes/fix-no-sign-option.md b/.changes/fix-no-sign-option.md deleted file mode 100644 index 71352c5ee..000000000 --- a/.changes/fix-no-sign-option.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -tauri-cli: patch:bug ---- - -Fixed an issue that caused the cli to error out with missing private key, in case the option `--no-sign` was requested and the `tauri.config` has signing key set and the plugin `tauri-plugin-updater` is used. - diff --git a/.changes/nsis-3.11.md b/.changes/nsis-3.11.md deleted file mode 100644 index 5d56bae0f..000000000 --- a/.changes/nsis-3.11.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri-bundler": patch:deps ---- - -Updated NSIS from 3.8 to 3.11 diff --git a/.changes/perf-remove-needless-clone.md b/.changes/perf-remove-needless-clone.md deleted file mode 100644 index 3e23288c4..000000000 --- a/.changes/perf-remove-needless-clone.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"tauri-bundler": patch:perf -"tauri-cli": patch:perf -"tauri-macos-sign": patch:perf -"tauri": patch:perf ---- - -perf: remove needless clones in various files for improved performance. No user facing changes. diff --git a/.changes/pnpm-package-version-check.md b/.changes/pnpm-package-version-check.md deleted file mode 100644 index 090e64995..000000000 --- a/.changes/pnpm-package-version-check.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"tauri-cli": patch:bug -"@tauri-apps/cli": patch:bug ---- - -Fixed the mismatched tauri package versions check didn't work for pnpm diff --git a/.changes/schema-carriage-return.md b/.changes/schema-carriage-return.md deleted file mode 100644 index 44bbf97d2..000000000 --- a/.changes/schema-carriage-return.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -tauri-utils: patch:bug ---- - -Fixed an issue that caused schema files to have `\r` characters on Windows. diff --git a/.changes/version-req-error.md b/.changes/version-req-error.md deleted file mode 100644 index 523d6f1c8..000000000 --- a/.changes/version-req-error.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -tauri-cli: patch:bug ---- - -Fixed an issue that caused the cli to print errors like `Error Failed to parse version 2 for crate tauri` when there was no `Cargo.lock` file present yet. This will still be logged in `--verbose` mode. diff --git a/Cargo.lock b/Cargo.lock index 85b84ee01..cddd7b662 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1319,7 +1319,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" dependencies = [ "lazy_static", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -4319,7 +4319,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -8494,7 +8494,7 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tauri" -version = "2.9.3" +version = "2.9.4" dependencies = [ "anyhow", "bytes", @@ -8554,7 +8554,7 @@ dependencies = [ [[package]] name = "tauri-build" -version = "2.5.2" +version = "2.5.3" dependencies = [ "anyhow", "cargo_toml", @@ -8576,7 +8576,7 @@ dependencies = [ [[package]] name = "tauri-bundler" -version = "2.7.3" +version = "2.7.4" dependencies = [ "anyhow", "ar", @@ -8622,7 +8622,7 @@ dependencies = [ [[package]] name = "tauri-cli" -version = "2.9.4" +version = "2.9.5" dependencies = [ "ar", "axum", @@ -8716,7 +8716,7 @@ dependencies = [ [[package]] name = "tauri-codegen" -version = "2.5.1" +version = "2.5.2" dependencies = [ "base64 0.22.1", "brotli", @@ -8782,7 +8782,7 @@ dependencies = [ [[package]] name = "tauri-macos-sign" -version = "2.3.0" +version = "2.3.1" dependencies = [ "apple-codesign", "chrono", @@ -8802,7 +8802,7 @@ dependencies = [ [[package]] name = "tauri-macros" -version = "2.5.1" +version = "2.5.2" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -8814,7 +8814,7 @@ dependencies = [ [[package]] name = "tauri-plugin" -version = "2.5.1" +version = "2.5.2" dependencies = [ "anyhow", "glob", @@ -8862,7 +8862,7 @@ dependencies = [ [[package]] name = "tauri-runtime" -version = "2.9.1" +version = "2.9.2" dependencies = [ "cookie", "dpi", @@ -8885,7 +8885,7 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "2.9.1" +version = "2.9.2" dependencies = [ "gtk", "http 1.3.1", @@ -8936,7 +8936,7 @@ dependencies = [ [[package]] name = "tauri-utils" -version = "2.8.0" +version = "2.8.1" dependencies = [ "aes-gcm", "anyhow", @@ -10324,7 +10324,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] diff --git a/crates/tauri-build/CHANGELOG.md b/crates/tauri-build/CHANGELOG.md index 8568ec929..4e5c9c97a 100644 --- a/crates/tauri-build/CHANGELOG.md +++ b/crates/tauri-build/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## \[2.5.3] + +### Dependencies + +- Upgraded to `tauri-utils@2.8.1` +- Upgraded to `tauri-codegen@2.5.2` + ## \[2.5.2] ### Dependencies diff --git a/crates/tauri-build/Cargo.toml b/crates/tauri-build/Cargo.toml index b8e3c6434..da35d963b 100644 --- a/crates/tauri-build/Cargo.toml +++ b/crates/tauri-build/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-build" -version = "2.5.2" +version = "2.5.3" description = "build time code to pair with https://crates.io/crates/tauri" exclude = ["CHANGELOG.md", "/target"] readme = "README.md" @@ -26,8 +26,8 @@ targets = [ [dependencies] anyhow = "1" quote = { version = "1", optional = true } -tauri-codegen = { version = "2.5.1", path = "../tauri-codegen", optional = true } -tauri-utils = { version = "2.8.0", path = "../tauri-utils", features = [ +tauri-codegen = { version = "2.5.2", path = "../tauri-codegen", optional = true } +tauri-utils = { version = "2.8.1", path = "../tauri-utils", features = [ "build", "resources", ] } diff --git a/crates/tauri-bundler/CHANGELOG.md b/crates/tauri-bundler/CHANGELOG.md index feb621512..0ae31a2bd 100644 --- a/crates/tauri-bundler/CHANGELOG.md +++ b/crates/tauri-bundler/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## \[2.7.4] + +### Bug Fixes + +- [`1496145f8`](https://www.github.com/tauri-apps/tauri/commit/1496145f8222649efeff22b819a96208670bbea1) ([#14585](https://www.github.com/tauri-apps/tauri/pull/14585) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) Fixed an issue that caused the AppImage bundler to fail with 404 errors for 32-bit builds. + +### Performance Improvements + +- [`ce98d87ce`](https://www.github.com/tauri-apps/tauri/commit/ce98d87ce0aaa907285852eb80691197424e03c3) ([#14474](https://www.github.com/tauri-apps/tauri/pull/14474) by [@Tunglies](https://www.github.com/tauri-apps/tauri/../../Tunglies)) refactor: remove needless collect. No user facing changes. +- [`ee3cc4a91`](https://www.github.com/tauri-apps/tauri/commit/ee3cc4a91bf1315ecaefe90f423ffd55ef6c40db) ([#14475](https://www.github.com/tauri-apps/tauri/pull/14475) by [@Tunglies](https://www.github.com/tauri-apps/tauri/../../Tunglies)) perf: remove needless clones in various files for improved performance. No user facing changes. + +### Dependencies + +- Upgraded to `tauri-macos-sign@2.3.1` +- Upgraded to `tauri-utils@2.8.1` +- [`b5ef603d8`](https://www.github.com/tauri-apps/tauri/commit/b5ef603d84bd8044625e50dcfdabb099b2e9fdd9) ([#14478](https://www.github.com/tauri-apps/tauri/pull/14478) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Updated NSIS from 3.8 to 3.11 + ## \[2.7.3] ### Enhancements diff --git a/crates/tauri-bundler/Cargo.toml b/crates/tauri-bundler/Cargo.toml index 5750480b7..351b072ed 100644 --- a/crates/tauri-bundler/Cargo.toml +++ b/crates/tauri-bundler/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-bundler" -version = "2.7.3" +version = "2.7.4" authors = [ "George Burton ", "Tauri Programme within The Commons Conservancy", @@ -15,7 +15,7 @@ rust-version = "1.77.2" exclude = ["CHANGELOG.md", "/target", "rustfmt.toml"] [dependencies] -tauri-utils = { version = "2.8.0", path = "../tauri-utils", features = [ +tauri-utils = { version = "2.8.1", path = "../tauri-utils", features = [ "resources", ] } image = "0.25" @@ -59,7 +59,7 @@ features = ["Win32_System_SystemInformation", "Win32_System_Diagnostics_Debug"] [target."cfg(target_os = \"macos\")".dependencies] icns = { package = "tauri-icns", version = "0.1" } time = { version = "0.3", features = ["formatting"] } -tauri-macos-sign = { version = "2.3.0", path = "../tauri-macos-sign" } +tauri-macos-sign = { version = "2.3.1", path = "../tauri-macos-sign" } [target."cfg(target_os = \"linux\")".dependencies] heck = "0.5" diff --git a/crates/tauri-cli/CHANGELOG.md b/crates/tauri-cli/CHANGELOG.md index 841035738..ba3f2baf5 100644 --- a/crates/tauri-cli/CHANGELOG.md +++ b/crates/tauri-cli/CHANGELOG.md @@ -1,5 +1,24 @@ # Changelog +## \[2.9.5] + +### Bug Fixes + +- [`f022b2d1a`](https://www.github.com/tauri-apps/tauri/commit/f022b2d1ae57612e39c75782926f2f341d9034a8) ([#14582](https://www.github.com/tauri-apps/tauri/pull/14582) by [@hrzlgnm](https://www.github.com/tauri-apps/tauri/../../hrzlgnm)) Fixed an issue that caused the cli to error out with missing private key, in case the option `--no-sign` was requested and the `tauri.config` has signing key set and the plugin `tauri-plugin-updater` is used. +- [`f855caf8a`](https://www.github.com/tauri-apps/tauri/commit/f855caf8a3830aa5dd6d0b039312866a5d9c3606) ([#14481](https://www.github.com/tauri-apps/tauri/pull/14481) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Fixed the mismatched tauri package versions check didn't work for pnpm +- [`79a7d9ec0`](https://www.github.com/tauri-apps/tauri/commit/79a7d9ec01be1a371b8e923848140fea75e9caed) ([#14468](https://www.github.com/tauri-apps/tauri/pull/14468) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) Fixed an issue that caused the cli to print errors like `Error Failed to parse version 2 for crate tauri` when there was no `Cargo.lock` file present yet. This will still be logged in `--verbose` mode. + +### Performance Improvements + +- [`ce98d87ce`](https://www.github.com/tauri-apps/tauri/commit/ce98d87ce0aaa907285852eb80691197424e03c3) ([#14474](https://www.github.com/tauri-apps/tauri/pull/14474) by [@Tunglies](https://www.github.com/tauri-apps/tauri/../../Tunglies)) refactor: remove needless collect. No user facing changes. +- [`ee3cc4a91`](https://www.github.com/tauri-apps/tauri/commit/ee3cc4a91bf1315ecaefe90f423ffd55ef6c40db) ([#14475](https://www.github.com/tauri-apps/tauri/pull/14475) by [@Tunglies](https://www.github.com/tauri-apps/tauri/../../Tunglies)) perf: remove needless clones in various files for improved performance. No user facing changes. + +### Dependencies + +- Upgraded to `tauri-bundler@2.7.4` +- Upgraded to `tauri-macos-sign@2.3.1` +- Upgraded to `tauri-utils@2.8.1` + ## \[2.9.4] ### Bug Fixes diff --git a/crates/tauri-cli/Cargo.toml b/crates/tauri-cli/Cargo.toml index 625db14b7..89d2ead0c 100644 --- a/crates/tauri-cli/Cargo.toml +++ b/crates/tauri-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-cli" -version = "2.9.4" +version = "2.9.5" authors = ["Tauri Programme within The Commons Conservancy"] edition = "2021" rust-version = "1.77.2" @@ -47,7 +47,7 @@ sublime_fuzzy = "0.7" clap_complete = "4" clap = { version = "4", features = ["derive", "env"] } thiserror = "2" -tauri-bundler = { version = "2.7.3", default-features = false, path = "../tauri-bundler" } +tauri-bundler = { version = "2.7.4", default-features = false, path = "../tauri-bundler" } colored = "2" serde = { version = "1", features = ["derive"] } serde_json = { version = "1", features = ["preserve_order"] } @@ -58,7 +58,7 @@ shared_child = "1" duct = "1.0" toml_edit = { version = "0.23", features = ["serde"] } json-patch = "3" -tauri-utils = { version = "2.8.0", path = "../tauri-utils", features = [ +tauri-utils = { version = "2.8.1", path = "../tauri-utils", features = [ "isolation", "schema", "config-json5", @@ -133,7 +133,7 @@ libc = "0.2" [target."cfg(target_os = \"macos\")".dependencies] plist = "1" -tauri-macos-sign = { version = "2.3.0", path = "../tauri-macos-sign" } +tauri-macos-sign = { version = "2.3.1", path = "../tauri-macos-sign" } object = { version = "0.36", default-features = false, features = [ "macho", "read_core", diff --git a/crates/tauri-cli/config.schema.json b/crates/tauri-cli/config.schema.json index b9cdcae1d..1d19c20ea 100644 --- a/crates/tauri-cli/config.schema.json +++ b/crates/tauri-cli/config.schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://schema.tauri.app/config/2.9.3", + "$id": "https://schema.tauri.app/config/2.9.4", "title": "Config", "description": "The Tauri configuration object.\n It is read from a file where you can define your frontend assets,\n configure the bundler and define a tray icon.\n\n The configuration file is generated by the\n [`tauri init`](https://v2.tauri.app/reference/cli/#init) command that lives in\n your Tauri application source directory (src-tauri).\n\n Once generated, you may modify it at will to customize your Tauri application.\n\n ## File Formats\n\n By default, the configuration is defined as a JSON file named `tauri.conf.json`.\n\n Tauri also supports JSON5 and TOML files via the `config-json5` and `config-toml` Cargo features, respectively.\n The JSON5 file name must be either `tauri.conf.json` or `tauri.conf.json5`.\n The TOML file name is `Tauri.toml`.\n\n ## Platform-Specific Configuration\n\n In addition to the default configuration file, Tauri can\n read a platform-specific configuration from `tauri.linux.conf.json`,\n `tauri.windows.conf.json`, `tauri.macos.conf.json`, `tauri.android.conf.json` and `tauri.ios.conf.json`\n (or `Tauri.linux.toml`, `Tauri.windows.toml`, `Tauri.macos.toml`, `Tauri.android.toml` and `Tauri.ios.toml` if the `Tauri.toml` format is used),\n which gets merged with the main configuration object.\n\n ## Configuration Structure\n\n The configuration is composed of the following objects:\n\n - [`app`](#appconfig): The Tauri configuration\n - [`build`](#buildconfig): The build configuration\n - [`bundle`](#bundleconfig): The bundle configurations\n - [`plugins`](#pluginconfig): The plugins configuration\n\n Example tauri.config.json file:\n\n ```json\n {\n \"productName\": \"tauri-app\",\n \"version\": \"0.1.0\",\n \"build\": {\n \"beforeBuildCommand\": \"\",\n \"beforeDevCommand\": \"\",\n \"devUrl\": \"http://localhost:3000\",\n \"frontendDist\": \"../dist\"\n },\n \"app\": {\n \"security\": {\n \"csp\": null\n },\n \"windows\": [\n {\n \"fullscreen\": false,\n \"height\": 600,\n \"resizable\": true,\n \"title\": \"Tauri App\",\n \"width\": 800\n }\n ]\n },\n \"bundle\": {},\n \"plugins\": {}\n }\n ```", "type": "object", diff --git a/crates/tauri-cli/metadata-v2.json b/crates/tauri-cli/metadata-v2.json index a3ad3dc81..b57586d4a 100644 --- a/crates/tauri-cli/metadata-v2.json +++ b/crates/tauri-cli/metadata-v2.json @@ -1,9 +1,9 @@ { "cli.js": { - "version": "2.9.4", + "version": "2.9.5", "node": ">= 10.0.0" }, - "tauri": "2.9.3", - "tauri-build": "2.5.2", - "tauri-plugin": "2.5.1" + "tauri": "2.9.4", + "tauri-build": "2.5.3", + "tauri-plugin": "2.5.2" } diff --git a/crates/tauri-codegen/CHANGELOG.md b/crates/tauri-codegen/CHANGELOG.md index 9d78e2b78..0da7581fe 100644 --- a/crates/tauri-codegen/CHANGELOG.md +++ b/crates/tauri-codegen/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## \[2.5.2] + +### Dependencies + +- Upgraded to `tauri-utils@2.8.1` + ## \[2.5.1] ### Performance Improvements diff --git a/crates/tauri-codegen/Cargo.toml b/crates/tauri-codegen/Cargo.toml index de391d521..4bb00a1ac 100644 --- a/crates/tauri-codegen/Cargo.toml +++ b/crates/tauri-codegen/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-codegen" -version = "2.5.1" +version = "2.5.2" description = "code generation meant to be consumed inside of `tauri` through `tauri-build` or `tauri-macros`" exclude = ["CHANGELOG.md", "/target"] readme = "README.md" @@ -20,7 +20,7 @@ quote = "1" syn = "2" serde = { version = "1", features = ["derive"] } serde_json = "1" -tauri-utils = { version = "2.8.0", path = "../tauri-utils", features = [ +tauri-utils = { version = "2.8.1", path = "../tauri-utils", features = [ "build", ] } thiserror = "2" diff --git a/crates/tauri-macos-sign/CHANGELOG.md b/crates/tauri-macos-sign/CHANGELOG.md index c45220b61..6da5a62a8 100644 --- a/crates/tauri-macos-sign/CHANGELOG.md +++ b/crates/tauri-macos-sign/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## \[2.3.1] + +### Performance Improvements + +- [`ee3cc4a91`](https://www.github.com/tauri-apps/tauri/commit/ee3cc4a91bf1315ecaefe90f423ffd55ef6c40db) ([#14475](https://www.github.com/tauri-apps/tauri/pull/14475) by [@Tunglies](https://www.github.com/tauri-apps/tauri/../../Tunglies)) perf: remove needless clones in various files for improved performance. No user facing changes. + ## \[2.3.0] ### Enhancements diff --git a/crates/tauri-macos-sign/Cargo.toml b/crates/tauri-macos-sign/Cargo.toml index 77984f71b..620c3f750 100644 --- a/crates/tauri-macos-sign/Cargo.toml +++ b/crates/tauri-macos-sign/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-macos-sign" -version = "2.3.0" +version = "2.3.1" authors = ["Tauri Programme within The Commons Conservancy"] license = "Apache-2.0 OR MIT" keywords = ["codesign", "signing", "macos", "ios", "tauri"] diff --git a/crates/tauri-macros/CHANGELOG.md b/crates/tauri-macros/CHANGELOG.md index 0775a58d4..61d35b3bc 100644 --- a/crates/tauri-macros/CHANGELOG.md +++ b/crates/tauri-macros/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## \[2.5.2] + +### Dependencies + +- Upgraded to `tauri-utils@2.8.1` +- Upgraded to `tauri-codegen@2.5.2` + ## \[2.5.1] ### Bug Fixes diff --git a/crates/tauri-macros/Cargo.toml b/crates/tauri-macros/Cargo.toml index 79d5a7230..7a096d01c 100644 --- a/crates/tauri-macros/Cargo.toml +++ b/crates/tauri-macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-macros" -version = "2.5.1" +version = "2.5.2" description = "Macros for the tauri crate." exclude = ["CHANGELOG.md", "/target"] readme = "README.md" @@ -20,8 +20,8 @@ proc-macro2 = { version = "1", features = ["span-locations"] } quote = "1" syn = { version = "2", features = ["full"] } heck = "0.5" -tauri-codegen = { version = "2.5.1", default-features = false, path = "../tauri-codegen" } -tauri-utils = { version = "2.8.0", path = "../tauri-utils" } +tauri-codegen = { version = "2.5.2", default-features = false, path = "../tauri-codegen" } +tauri-utils = { version = "2.8.1", path = "../tauri-utils" } [features] custom-protocol = [] diff --git a/crates/tauri-plugin/CHANGELOG.md b/crates/tauri-plugin/CHANGELOG.md index 104093af2..51505ca06 100644 --- a/crates/tauri-plugin/CHANGELOG.md +++ b/crates/tauri-plugin/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## \[2.5.2] + +### Dependencies + +- Upgraded to `tauri-utils@2.8.1` + ## \[2.5.1] ### Bug Fixes diff --git a/crates/tauri-plugin/Cargo.toml b/crates/tauri-plugin/Cargo.toml index 971d8c50f..c774a8862 100644 --- a/crates/tauri-plugin/Cargo.toml +++ b/crates/tauri-plugin/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-plugin" -version = "2.5.1" +version = "2.5.2" description = "Build script and runtime Tauri plugin definitions" authors.workspace = true homepage.workspace = true @@ -28,7 +28,7 @@ runtime = [] [dependencies] anyhow = { version = "1", optional = true } serde = { version = "1", optional = true } -tauri-utils = { version = "2.8.0", default-features = false, features = [ +tauri-utils = { version = "2.8.1", default-features = false, features = [ "build", ], path = "../tauri-utils" } serde_json = { version = "1", optional = true } diff --git a/crates/tauri-runtime-wry/CHANGELOG.md b/crates/tauri-runtime-wry/CHANGELOG.md index d9ac4f1d1..2fee3f822 100644 --- a/crates/tauri-runtime-wry/CHANGELOG.md +++ b/crates/tauri-runtime-wry/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## \[2.9.2] + +### Dependencies + +- Upgraded to `tauri-utils@2.8.1` +- Upgraded to `tauri-runtime@2.9.2` + ## \[2.9.1] ### Bug Fixes diff --git a/crates/tauri-runtime-wry/Cargo.toml b/crates/tauri-runtime-wry/Cargo.toml index e247f3793..3284cddbd 100644 --- a/crates/tauri-runtime-wry/Cargo.toml +++ b/crates/tauri-runtime-wry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-runtime-wry" -version = "2.9.1" +version = "2.9.2" description = "Wry bindings to the Tauri runtime" exclude = ["CHANGELOG.md", "/target"] readme = "README.md" @@ -20,8 +20,8 @@ wry = { version = "0.53.4", default-features = false, features = [ "linux-body", ] } tao = { version = "0.34.5", default-features = false, features = ["rwh_06"] } -tauri-runtime = { version = "2.9.1", path = "../tauri-runtime" } -tauri-utils = { version = "2.8.0", path = "../tauri-utils" } +tauri-runtime = { version = "2.9.2", path = "../tauri-runtime" } +tauri-utils = { version = "2.8.1", path = "../tauri-utils" } raw-window-handle = "0.6" http = "1" url = "2" diff --git a/crates/tauri-runtime/CHANGELOG.md b/crates/tauri-runtime/CHANGELOG.md index edf7e1a03..c4ae73bec 100644 --- a/crates/tauri-runtime/CHANGELOG.md +++ b/crates/tauri-runtime/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## \[2.9.2] + +### Dependencies + +- Upgraded to `tauri-utils@2.8.1` + ## \[2.9.1] ### Bug Fixes diff --git a/crates/tauri-runtime/Cargo.toml b/crates/tauri-runtime/Cargo.toml index b269b8d32..53db45873 100644 --- a/crates/tauri-runtime/Cargo.toml +++ b/crates/tauri-runtime/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-runtime" -version = "2.9.1" +version = "2.9.2" description = "Runtime for Tauri applications" exclude = ["CHANGELOG.md", "/target"] readme = "README.md" @@ -27,7 +27,7 @@ targets = [ serde = { version = "1", features = ["derive"] } serde_json = "1" thiserror = "2" -tauri-utils = { version = "2.8.0", path = "../tauri-utils" } +tauri-utils = { version = "2.8.1", path = "../tauri-utils" } http = "1" raw-window-handle = "0.6" url = { version = "2" } diff --git a/crates/tauri-schema-generator/schemas/config.schema.json b/crates/tauri-schema-generator/schemas/config.schema.json index b9cdcae1d..1d19c20ea 100644 --- a/crates/tauri-schema-generator/schemas/config.schema.json +++ b/crates/tauri-schema-generator/schemas/config.schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://schema.tauri.app/config/2.9.3", + "$id": "https://schema.tauri.app/config/2.9.4", "title": "Config", "description": "The Tauri configuration object.\n It is read from a file where you can define your frontend assets,\n configure the bundler and define a tray icon.\n\n The configuration file is generated by the\n [`tauri init`](https://v2.tauri.app/reference/cli/#init) command that lives in\n your Tauri application source directory (src-tauri).\n\n Once generated, you may modify it at will to customize your Tauri application.\n\n ## File Formats\n\n By default, the configuration is defined as a JSON file named `tauri.conf.json`.\n\n Tauri also supports JSON5 and TOML files via the `config-json5` and `config-toml` Cargo features, respectively.\n The JSON5 file name must be either `tauri.conf.json` or `tauri.conf.json5`.\n The TOML file name is `Tauri.toml`.\n\n ## Platform-Specific Configuration\n\n In addition to the default configuration file, Tauri can\n read a platform-specific configuration from `tauri.linux.conf.json`,\n `tauri.windows.conf.json`, `tauri.macos.conf.json`, `tauri.android.conf.json` and `tauri.ios.conf.json`\n (or `Tauri.linux.toml`, `Tauri.windows.toml`, `Tauri.macos.toml`, `Tauri.android.toml` and `Tauri.ios.toml` if the `Tauri.toml` format is used),\n which gets merged with the main configuration object.\n\n ## Configuration Structure\n\n The configuration is composed of the following objects:\n\n - [`app`](#appconfig): The Tauri configuration\n - [`build`](#buildconfig): The build configuration\n - [`bundle`](#bundleconfig): The bundle configurations\n - [`plugins`](#pluginconfig): The plugins configuration\n\n Example tauri.config.json file:\n\n ```json\n {\n \"productName\": \"tauri-app\",\n \"version\": \"0.1.0\",\n \"build\": {\n \"beforeBuildCommand\": \"\",\n \"beforeDevCommand\": \"\",\n \"devUrl\": \"http://localhost:3000\",\n \"frontendDist\": \"../dist\"\n },\n \"app\": {\n \"security\": {\n \"csp\": null\n },\n \"windows\": [\n {\n \"fullscreen\": false,\n \"height\": 600,\n \"resizable\": true,\n \"title\": \"Tauri App\",\n \"width\": 800\n }\n ]\n },\n \"bundle\": {},\n \"plugins\": {}\n }\n ```", "type": "object", diff --git a/crates/tauri-utils/CHANGELOG.md b/crates/tauri-utils/CHANGELOG.md index 538887203..a63e5103b 100644 --- a/crates/tauri-utils/CHANGELOG.md +++ b/crates/tauri-utils/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## \[2.8.1] + +### Bug Fixes + +- [`1573c7240`](https://www.github.com/tauri-apps/tauri/commit/1573c72402352949d1fd3ca5c6fdbee46fe69fbb) ([#14561](https://www.github.com/tauri-apps/tauri/pull/14561) by [@FabianLars](https://www.github.com/tauri-apps/tauri/../../FabianLars)) Fixed an issue that caused schema files to have `\r` characters on Windows. + ## \[2.8.0] ### New Features diff --git a/crates/tauri-utils/Cargo.toml b/crates/tauri-utils/Cargo.toml index 7cc6f5c78..25debb2db 100644 --- a/crates/tauri-utils/Cargo.toml +++ b/crates/tauri-utils/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-utils" -version = "2.8.0" +version = "2.8.1" description = "Utilities for Tauri" exclude = ["CHANGELOG.md", "/target"] readme = "README.md" diff --git a/crates/tauri/CHANGELOG.md b/crates/tauri/CHANGELOG.md index e1332ea34..d4b868f5e 100644 --- a/crates/tauri/CHANGELOG.md +++ b/crates/tauri/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## \[2.9.4] + +### Performance Improvements + +- [`ce98d87ce`](https://www.github.com/tauri-apps/tauri/commit/ce98d87ce0aaa907285852eb80691197424e03c3) ([#14474](https://www.github.com/tauri-apps/tauri/pull/14474) by [@Tunglies](https://www.github.com/tauri-apps/tauri/../../Tunglies)) refactor: remove needless collect. No user facing changes. +- [`ee3cc4a91`](https://www.github.com/tauri-apps/tauri/commit/ee3cc4a91bf1315ecaefe90f423ffd55ef6c40db) ([#14475](https://www.github.com/tauri-apps/tauri/pull/14475) by [@Tunglies](https://www.github.com/tauri-apps/tauri/../../Tunglies)) perf: remove needless clones in various files for improved performance. No user facing changes. + +### Dependencies + +- Upgraded to `tauri-utils@2.8.1` +- Upgraded to `tauri-runtime@2.9.2` +- Upgraded to `tauri-runtime-wry@2.9.2` +- Upgraded to `tauri-macros@2.5.2` +- Upgraded to `tauri-build@2.5.3` + ## \[2.9.3] ### Bug Fixes diff --git a/crates/tauri/Cargo.toml b/crates/tauri/Cargo.toml index dda4f4124..48336f82a 100644 --- a/crates/tauri/Cargo.toml +++ b/crates/tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri" -version = "2.9.3" +version = "2.9.4" description = "Make tiny, secure apps for all desktop platforms with Tauri" exclude = ["/test", "/.scripts", "CHANGELOG.md", "/target"] readme = "README.md" @@ -55,12 +55,12 @@ uuid = { version = "1", features = ["v4"], optional = true } url = "2" anyhow = "1" thiserror = "2" -tauri-runtime = { version = "2.9.1", path = "../tauri-runtime" } -tauri-macros = { version = "2.5.1", path = "../tauri-macros" } -tauri-utils = { version = "2.8.0", features = [ +tauri-runtime = { version = "2.9.2", path = "../tauri-runtime" } +tauri-macros = { version = "2.5.2", path = "../tauri-macros" } +tauri-utils = { version = "2.8.1", features = [ "resources", ], path = "../tauri-utils" } -tauri-runtime-wry = { version = "2.9.1", path = "../tauri-runtime-wry", default-features = false, optional = true } +tauri-runtime-wry = { version = "2.9.2", path = "../tauri-runtime-wry", default-features = false, optional = true } getrandom = "0.3" serde_repr = "0.1" http = "1" @@ -162,8 +162,8 @@ objc2-ui-kit = { version = "0.3.0", default-features = false, features = [ [build-dependencies] glob = "0.3" heck = "0.5" -tauri-build = { path = "../tauri-build/", default-features = false, version = "2.5.2" } -tauri-utils = { path = "../tauri-utils/", version = "2.8.0", features = [ +tauri-build = { path = "../tauri-build/", default-features = false, version = "2.5.3" } +tauri-utils = { path = "../tauri-utils/", version = "2.8.1", features = [ "build", ] } diff --git a/packages/api/CHANGELOG.md b/packages/api/CHANGELOG.md index be0325b77..f9cce7cdf 100644 --- a/packages/api/CHANGELOG.md +++ b/packages/api/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## \[2.9.1] + +### Bug Fixes + +- [`ad1dec2e2`](https://www.github.com/tauri-apps/tauri/commit/ad1dec2e2488fe5c0a004b69f1bd290dfc593bf8) ([#14464](https://www.github.com/tauri-apps/tauri/pull/14464) by [@funnydino](https://www.github.com/tauri-apps/tauri/../../funnydino)) Fix `addPluginListener` fallback added in https://github.com/tauri-apps/tauri/pull/14132 didn't work properly + ## \[2.9.0] ### New Features diff --git a/packages/api/package.json b/packages/api/package.json index 57628957b..bc7aba711 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/api", - "version": "2.9.0", + "version": "2.9.1", "description": "Tauri API definitions", "funding": { "type": "opencollective", diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index b242fd9ca..669c6b313 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## \[2.9.5] + +### Bug Fixes + +- [`f855caf8a`](https://www.github.com/tauri-apps/tauri/commit/f855caf8a3830aa5dd6d0b039312866a5d9c3606) ([#14481](https://www.github.com/tauri-apps/tauri/pull/14481) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Fixed the mismatched tauri package versions check didn't work for pnpm + +### Performance Improvements + +- [`ce98d87ce`](https://www.github.com/tauri-apps/tauri/commit/ce98d87ce0aaa907285852eb80691197424e03c3) ([#14474](https://www.github.com/tauri-apps/tauri/pull/14474) by [@Tunglies](https://www.github.com/tauri-apps/tauri/../../Tunglies)) refactor: remove needless collect. No user facing changes. + +### Dependencies + +- Upgraded to `tauri-cli@2.9.5` + ## \[2.9.4] ### Bug Fixes diff --git a/packages/cli/package.json b/packages/cli/package.json index cf9a13172..0d2bf618c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/cli", - "version": "2.9.4", + "version": "2.9.5", "description": "Command line interface for building Tauri apps", "type": "commonjs", "funding": { From 4176f93ae43ef66714c4934feb3df19df3a3e28a Mon Sep 17 00:00:00 2001 From: chfaft <129761080+chfaft@users.noreply.github.com> Date: Tue, 2 Dec 2025 02:58:35 +0100 Subject: [PATCH 06/57] feat(bundler): consider extensions defined in main.wxs. (#14570) * feat(bundler): consider extensions defined in main.wxs. * chore(bundler): apply nitpick and add a change file. * Update crates/tauri-bundler/src/bundle/windows/msi/mod.rs chore(bundler): avoid clone and use reference. Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com> * Update .changes/support-template-extensions.md chore(bundler): reclassify changes. Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com> --------- Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com> --- .changes/support-template-extensions.md | 5 +++++ .../src/bundle/windows/msi/mod.rs | 20 ++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) create mode 100644 .changes/support-template-extensions.md diff --git a/.changes/support-template-extensions.md b/.changes/support-template-extensions.md new file mode 100644 index 000000000..8fa4654c9 --- /dev/null +++ b/.changes/support-template-extensions.md @@ -0,0 +1,5 @@ +--- +tauri-bundler: patch:enhance +--- + +Consider extensions that are defined in the wxs template. diff --git a/crates/tauri-bundler/src/bundle/windows/msi/mod.rs b/crates/tauri-bundler/src/bundle/windows/msi/mod.rs index cc5f83883..4c00d8f33 100644 --- a/crates/tauri-bundler/src/bundle/windows/msi/mod.rs +++ b/crates/tauri-bundler/src/bundle/windows/msi/mod.rs @@ -753,26 +753,28 @@ pub fn build_wix_app_installer( } let main_wxs_path = output_path.join("main.wxs"); - fs::write(main_wxs_path, handlebars.render("main.wxs", &data)?)?; + fs::write(&main_wxs_path, handlebars.render("main.wxs", &data)?)?; - let mut candle_inputs = vec![("main.wxs".into(), Vec::new())]; + let mut candle_inputs = vec![]; let current_dir = std::env::current_dir()?; let extension_regex = Regex::new("\"http://schemas.microsoft.com/wix/(\\w+)\"")?; - for fragment_path in fragment_paths { - let fragment_path = current_dir.join(fragment_path); - let fragment_content = fs::read_to_string(&fragment_path)?; - let fragment_handlebars = Handlebars::new(); - let fragment = fragment_handlebars.render_template(&fragment_content, &data)?; + let input_paths = + std::iter::once(main_wxs_path).chain(fragment_paths.iter().map(|p| current_dir.join(p))); + + for input_path in input_paths { + let input_content = fs::read_to_string(&input_path)?; + let input_handlebars = Handlebars::new(); + let input = input_handlebars.render_template(&input_content, &data)?; let mut extensions = Vec::new(); - for cap in extension_regex.captures_iter(&fragment) { + for cap in extension_regex.captures_iter(&input) { let path = wix_toolset_path.join(format!("Wix{}.dll", &cap[1])); if settings.windows().can_sign() { try_sign(&path, settings)?; } extensions.push(path); } - candle_inputs.push((fragment_path, extensions)); + candle_inputs.push((input_path, extensions)); } let mut fragment_extensions = HashSet::new(); From 60174527c06950964ed5146eca1be0088321c800 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 10:19:09 +0800 Subject: [PATCH 07/57] chore(deps): update rust crate ico to 0.5 (#14589) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/tauri-codegen/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cddd7b662..56d688771 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3467,9 +3467,9 @@ dependencies = [ [[package]] name = "ico" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc50b891e4acf8fe0e71ef88ec43ad82ee07b3810ad09de10f1d01f072ed4b98" +checksum = "3e795dff5605e0f04bff85ca41b51a96b83e80b281e96231bcaaf1ac35103371" dependencies = [ "byteorder", "png", diff --git a/crates/tauri-codegen/Cargo.toml b/crates/tauri-codegen/Cargo.toml index 4bb00a1ac..751ef1402 100644 --- a/crates/tauri-codegen/Cargo.toml +++ b/crates/tauri-codegen/Cargo.toml @@ -30,7 +30,7 @@ brotli = { version = "8", optional = true, default-features = false, features = ] } uuid = { version = "1", features = ["v4"] } semver = "1" -ico = "0.4" +ico = "0.5" png = "0.17" json-patch = "3" url = "2" From 514cf21e1417c7a78a0db494f891ba79d948b73d Mon Sep 17 00:00:00 2001 From: Tunglies Date: Tue, 2 Dec 2025 10:20:35 +0800 Subject: [PATCH 08/57] chore(deps): update num-bigint-dig to version 0.8.6 (#14591) * chore(deps): update num-bigint-dig to version 0.8.6 * Update .changes/bump-version-num-bigint-dig.md --------- Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com> --- .changes/bump-version-num-bigint-dig.md | 5 +++++ Cargo.lock | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 .changes/bump-version-num-bigint-dig.md diff --git a/.changes/bump-version-num-bigint-dig.md b/.changes/bump-version-num-bigint-dig.md new file mode 100644 index 000000000..5b7214e58 --- /dev/null +++ b/.changes/bump-version-num-bigint-dig.md @@ -0,0 +1,5 @@ +--- +"tauri-macos-sign": patch:deps +--- + +Update num-bigint-dig from 0.8.4 to 0.8.6 \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 56d688771..407c0f444 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4897,11 +4897,10 @@ dependencies = [ [[package]] name = "num-bigint-dig" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +checksum = "e661dda6640fad38e827a6d4a310ff4763082116fe217f279885c97f511bb0b7" dependencies = [ - "byteorder", "lazy_static", "libm", "num-integer", From 546b296405bfff42f2181e1bacbb9724e32c469e Mon Sep 17 00:00:00 2001 From: sftse Date: Fri, 5 Dec 2025 04:56:34 +0100 Subject: [PATCH 09/57] fix(tauri-bundler): add a bit more context to error message (#14606) --- crates/tauri-bundler/src/bundle/linux/debian.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/tauri-bundler/src/bundle/linux/debian.rs b/crates/tauri-bundler/src/bundle/linux/debian.rs index a99409728..3fedef4b7 100644 --- a/crates/tauri-bundler/src/bundle/linux/debian.rs +++ b/crates/tauri-bundler/src/bundle/linux/debian.rs @@ -119,8 +119,9 @@ pub fn generate_data( for bin in settings.binaries() { let bin_path = settings.binary_path(bin); - fs_utils::copy_file(&bin_path, &bin_dir.join(bin.name())) - .with_context(|| format!("Failed to copy binary from {bin_path:?}"))?; + let trgt = bin_dir.join(bin.name()); + fs_utils::copy_file(&bin_path, &trgt) + .with_context(|| format!("Failed to copy binary from {bin_path:?} to {trgt:?}"))?; } copy_resource_files(settings, &data_dir).with_context(|| "Failed to copy resource files")?; From 7b1b3514df771e6e9859b9f54fa4df332433948e Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Sun, 7 Dec 2025 21:06:27 +0800 Subject: [PATCH 10/57] changes(cli): log npm package version parse in debug level (#14621) --- .changes/version-req-error.md | 5 +++++ crates/tauri-cli/src/helpers/npm.rs | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changes/version-req-error.md diff --git a/.changes/version-req-error.md b/.changes/version-req-error.md new file mode 100644 index 000000000..902151b34 --- /dev/null +++ b/.changes/version-req-error.md @@ -0,0 +1,5 @@ +--- +tauri-cli: patch:changes +--- + +Errors like `Error Failed to parse version 2 for for NPM package tauri` when there was no `package-lock.json` file present yet or when using ones like `link:./tauri` are now only logged in `--verbose` mode. diff --git a/crates/tauri-cli/src/helpers/npm.rs b/crates/tauri-cli/src/helpers/npm.rs index 58df0d443..eced925ac 100644 --- a/crates/tauri-cli/src/helpers/npm.rs +++ b/crates/tauri-cli/src/helpers/npm.rs @@ -345,7 +345,7 @@ impl PackageManager { if let Ok(version) = semver::Version::parse(&version) { versions.insert(package, version); } else { - log::error!("Failed to parse version `{version}` for NPM package `{package}`"); + log::debug!("Failed to parse version `{version}` for NPM package `{package}`"); } } Ok(versions) @@ -397,7 +397,7 @@ fn yarn_package_versions( if let Ok(version) = semver::Version::parse(version) { versions.insert(name.to_owned(), version); } else { - log::error!("Failed to parse version `{version}` for NPM package `{name}`"); + log::debug!("Failed to parse version `{version}` for NPM package `{name}`"); } } return Ok(versions); @@ -450,7 +450,7 @@ fn yarn_berry_package_versions( if let Ok(version) = semver::Version::parse(&version) { versions.insert(name.to_owned(), version); } else { - log::error!("Failed to parse version `{version}` for NPM package `{name}`"); + log::debug!("Failed to parse version `{version}` for NPM package `{name}`"); } } } From 731dd5bfdc62505c904bf8e7262bb5c1428b5a5a Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Sun, 7 Dec 2025 23:09:11 +0800 Subject: [PATCH 11/57] docs: remove `$APP` and `$LOG` from `FsScope` (#14623) --- crates/tauri-cli/config.schema.json | 2 +- crates/tauri-schema-generator/schemas/config.schema.json | 2 +- crates/tauri-utils/src/config.rs | 4 ++-- .../tests/acl/fixtures/capabilities/scope-extended/cap.json | 4 ++-- crates/tests/acl/fixtures/plugins/fs/scope.toml | 4 ++-- crates/tests/acl/fixtures/plugins/os/windows.toml | 2 +- .../snapshots/acl_tests__tests__file-explorer-remote.snap | 2 +- .../fixtures/snapshots/acl_tests__tests__file-explorer.snap | 2 +- .../fixtures/snapshots/acl_tests__tests__multiwindow.snap | 2 +- .../snapshots/acl_tests__tests__scope-extended.snap | 6 +++--- .../acl/fixtures/snapshots/acl_tests__tests__scope.snap | 2 +- .../acl_tests__tests__platform-specific-permissions.snap | 2 +- 12 files changed, 17 insertions(+), 17 deletions(-) diff --git a/crates/tauri-cli/config.schema.json b/crates/tauri-cli/config.schema.json index 1d19c20ea..c71bf6e2d 100644 --- a/crates/tauri-cli/config.schema.json +++ b/crates/tauri-cli/config.schema.json @@ -1296,7 +1296,7 @@ "additionalProperties": false }, "FsScope": { - "description": "Protocol scope definition.\n It is a list of glob patterns that restrict the API access from the webview.\n\n Each pattern can start with a variable that resolves to a system base directory.\n The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`,\n `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`,\n `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`,\n `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", + "description": "Protocol scope definition.\n It is a list of glob patterns that restrict the API access from the webview.\n\n Each pattern can start with a variable that resolves to a system base directory.\n The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`,\n `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`,\n `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$TEMP`,\n `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", "anyOf": [ { "description": "A list of paths that are allowed by this scope.", diff --git a/crates/tauri-schema-generator/schemas/config.schema.json b/crates/tauri-schema-generator/schemas/config.schema.json index 1d19c20ea..c71bf6e2d 100644 --- a/crates/tauri-schema-generator/schemas/config.schema.json +++ b/crates/tauri-schema-generator/schemas/config.schema.json @@ -1296,7 +1296,7 @@ "additionalProperties": false }, "FsScope": { - "description": "Protocol scope definition.\n It is a list of glob patterns that restrict the API access from the webview.\n\n Each pattern can start with a variable that resolves to a system base directory.\n The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`,\n `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`,\n `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`,\n `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", + "description": "Protocol scope definition.\n It is a list of glob patterns that restrict the API access from the webview.\n\n Each pattern can start with a variable that resolves to a system base directory.\n The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`,\n `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`,\n `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$TEMP`,\n `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`.", "anyOf": [ { "description": "A list of paths that are allowed by this scope.", diff --git a/crates/tauri-utils/src/config.rs b/crates/tauri-utils/src/config.rs index 37c77abff..c90dc3e59 100644 --- a/crates/tauri-utils/src/config.rs +++ b/crates/tauri-utils/src/config.rs @@ -2211,8 +2211,8 @@ impl Default for DisabledCspModificationKind { /// Each pattern can start with a variable that resolves to a system base directory. /// The variables are: `$AUDIO`, `$CACHE`, `$CONFIG`, `$DATA`, `$LOCALDATA`, `$DESKTOP`, /// `$DOCUMENT`, `$DOWNLOAD`, `$EXE`, `$FONT`, `$HOME`, `$PICTURE`, `$PUBLIC`, `$RUNTIME`, -/// `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$APP`, `$LOG`, `$TEMP`, `$APPCONFIG`, `$APPDATA`, -/// `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`. +/// `$TEMPLATE`, `$VIDEO`, `$RESOURCE`, `$TEMP`, +/// `$APPCONFIG`, `$APPDATA`, `$APPLOCALDATA`, `$APPCACHE`, `$APPLOG`. #[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)] #[serde(untagged)] #[cfg_attr(feature = "schema", derive(JsonSchema))] diff --git a/crates/tests/acl/fixtures/capabilities/scope-extended/cap.json b/crates/tests/acl/fixtures/capabilities/scope-extended/cap.json index 26355eed5..78ec36d96 100644 --- a/crates/tests/acl/fixtures/capabilities/scope-extended/cap.json +++ b/crates/tests/acl/fixtures/capabilities/scope-extended/cap.json @@ -25,12 +25,12 @@ "identifier": "fs:allow-app", "allow": [ { - "path": "$APP/**" + "path": "$APPDATA/**" } ], "deny": [ { - "path": "$APP/*.db" + "path": "$APPDATA/*.db" } ] }, diff --git a/crates/tests/acl/fixtures/plugins/fs/scope.toml b/crates/tests/acl/fixtures/plugins/fs/scope.toml index 6d8a29a3f..efe82a96c 100644 --- a/crates/tests/acl/fixtures/plugins/fs/scope.toml +++ b/crates/tests/acl/fixtures/plugins/fs/scope.toml @@ -1,8 +1,8 @@ [[permission]] identifier = "allow-app" -description = "Allows accessing the $APP path." +description = "Allows accessing the $APPDATA path." [[permission.scope.allow]] -path = "$APP" +path = "$APPDATA" [[permission]] identifier = "allow-download-dir" diff --git a/crates/tests/acl/fixtures/plugins/os/windows.toml b/crates/tests/acl/fixtures/plugins/os/windows.toml index 577b0c967..1f84a6d99 100644 --- a/crates/tests/acl/fixtures/plugins/os/windows.toml +++ b/crates/tests/acl/fixtures/plugins/os/windows.toml @@ -3,4 +3,4 @@ identifier = "deny-webview-folder-windows" platforms = ["windows"] description = "Denies access to the webview folder on Windows" [[permission.scope.deny]] -path = "$APP/EBWebView/**" +path = "$APPLOCALDATA/EBWebView/**" diff --git a/crates/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer-remote.snap b/crates/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer-remote.snap index dd9b05093..50029e7bd 100644 --- a/crates/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer-remote.snap +++ b/crates/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer-remote.snap @@ -398,7 +398,7 @@ Resolved { Map( { "path": String( - "$APP", + "$APPDATA", ), }, ), diff --git a/crates/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer.snap b/crates/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer.snap index a3e4cd8b3..03f795b43 100644 --- a/crates/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer.snap +++ b/crates/tests/acl/fixtures/snapshots/acl_tests__tests__file-explorer.snap @@ -68,7 +68,7 @@ Resolved { Map( { "path": String( - "$APP", + "$APPDATA", ), }, ), diff --git a/crates/tests/acl/fixtures/snapshots/acl_tests__tests__multiwindow.snap b/crates/tests/acl/fixtures/snapshots/acl_tests__tests__multiwindow.snap index f80ef7566..95ba3490d 100644 --- a/crates/tests/acl/fixtures/snapshots/acl_tests__tests__multiwindow.snap +++ b/crates/tests/acl/fixtures/snapshots/acl_tests__tests__multiwindow.snap @@ -310,7 +310,7 @@ Resolved { Map( { "path": String( - "$APP", + "$APPDATA", ), }, ), diff --git a/crates/tests/acl/fixtures/snapshots/acl_tests__tests__scope-extended.snap b/crates/tests/acl/fixtures/snapshots/acl_tests__tests__scope-extended.snap index 41d2d99d7..7f1606fae 100644 --- a/crates/tests/acl/fixtures/snapshots/acl_tests__tests__scope-extended.snap +++ b/crates/tests/acl/fixtures/snapshots/acl_tests__tests__scope-extended.snap @@ -244,14 +244,14 @@ Resolved { Map( { "path": String( - "$APP/**", + "$APPDATA/**", ), }, ), Map( { "path": String( - "$APP", + "$APPDATA", ), }, ), @@ -281,7 +281,7 @@ Resolved { Map( { "path": String( - "$APP/*.db", + "$APPDATA/*.db", ), }, ), diff --git a/crates/tests/acl/fixtures/snapshots/acl_tests__tests__scope.snap b/crates/tests/acl/fixtures/snapshots/acl_tests__tests__scope.snap index e98810961..b74d04381 100644 --- a/crates/tests/acl/fixtures/snapshots/acl_tests__tests__scope.snap +++ b/crates/tests/acl/fixtures/snapshots/acl_tests__tests__scope.snap @@ -208,7 +208,7 @@ Resolved { Map( { "path": String( - "$APP", + "$APPDATA", ), }, ), diff --git a/crates/tests/acl/fixtures/snapshots/windows/acl_tests__tests__platform-specific-permissions.snap b/crates/tests/acl/fixtures/snapshots/windows/acl_tests__tests__platform-specific-permissions.snap index 618dcd1a7..17498f928 100644 --- a/crates/tests/acl/fixtures/snapshots/windows/acl_tests__tests__platform-specific-permissions.snap +++ b/crates/tests/acl/fixtures/snapshots/windows/acl_tests__tests__platform-specific-permissions.snap @@ -56,7 +56,7 @@ Resolved { Map( { "path": String( - "$APP/EBWebView/**", + "$APPLOCALDATA/EBWebView/**", ), }, ), From 018b4db22e167fa67b37b0933e192a0f3556d3e5 Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Mon, 8 Dec 2025 20:13:43 +0800 Subject: [PATCH 12/57] fix(bundler): skip signing for nsis uninstaller on `--no-sign` (#14625) --- .changes/no-sign-skip-nsis-uninstaller.md | 5 +++++ crates/tauri-bundler/src/bundle.rs | 2 +- crates/tauri-bundler/src/bundle/windows/nsis/mod.rs | 8 ++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 .changes/no-sign-skip-nsis-uninstaller.md diff --git a/.changes/no-sign-skip-nsis-uninstaller.md b/.changes/no-sign-skip-nsis-uninstaller.md new file mode 100644 index 000000000..3e7952d93 --- /dev/null +++ b/.changes/no-sign-skip-nsis-uninstaller.md @@ -0,0 +1,5 @@ +--- +tauri-bundler: patch:bug +--- + +Skip signing for NSIS uninstaller when using `--no-sign` flag diff --git a/crates/tauri-bundler/src/bundle.rs b/crates/tauri-bundler/src/bundle.rs index 654ad5647..bac77c041 100644 --- a/crates/tauri-bundler/src/bundle.rs +++ b/crates/tauri-bundler/src/bundle.rs @@ -273,7 +273,7 @@ fn sign_binaries_if_needed(settings: &Settings, target_os: &TargetPlatform) -> c if matches!(target_os, TargetPlatform::Windows) { if settings.windows().can_sign() { if settings.no_sign() { - log::info!("Skipping binary signing due to --no-sign flag."); + log::warn!("Skipping binary signing due to --no-sign flag."); return Ok(()); } diff --git a/crates/tauri-bundler/src/bundle/windows/nsis/mod.rs b/crates/tauri-bundler/src/bundle/windows/nsis/mod.rs index 8b2bc4eef..f456ed97a 100644 --- a/crates/tauri-bundler/src/bundle/windows/nsis/mod.rs +++ b/crates/tauri-bundler/src/bundle/windows/nsis/mod.rs @@ -298,8 +298,12 @@ fn build_nsis_app_installer( data.insert("copyright", to_json(settings.copyright_string())); if settings.windows().can_sign() { - let sign_cmd = format!("{:?}", sign_command("%1", &settings.sign_params())?); - data.insert("uninstaller_sign_cmd", to_json(sign_cmd)); + if settings.no_sign() { + log::warn!("Skipping signing for NSIS uninstaller due to --no-sign flag."); + } else { + let sign_cmd = format!("{:?}", sign_command("%1", &settings.sign_params())?); + data.insert("uninstaller_sign_cmd", to_json(sign_cmd)); + } } let version = settings.version_string(); From 91becd9e4fa2db089ddc6b21dadc06133e939e08 Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Mon, 8 Dec 2025 20:13:52 +0800 Subject: [PATCH 13/57] fix(nsis): plugins not signed (#14627) --- .changes/nsis-plugin-sign-path.md | 5 +++++ .../src/bundle/windows/nsis/mod.rs | 17 ++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 .changes/nsis-plugin-sign-path.md diff --git a/.changes/nsis-plugin-sign-path.md b/.changes/nsis-plugin-sign-path.md new file mode 100644 index 000000000..99f4f6861 --- /dev/null +++ b/.changes/nsis-plugin-sign-path.md @@ -0,0 +1,5 @@ +--- +tauri-bundler: patch:bug +--- + +Fix NSIS plugins not being signed due to wrong path handlings diff --git a/crates/tauri-bundler/src/bundle/windows/nsis/mod.rs b/crates/tauri-bundler/src/bundle/windows/nsis/mod.rs index f456ed97a..d4d8f2cac 100644 --- a/crates/tauri-bundler/src/bundle/windows/nsis/mod.rs +++ b/crates/tauri-bundler/src/bundle/windows/nsis/mod.rs @@ -621,13 +621,16 @@ fn build_nsis_app_installer( fs::create_dir_all(nsis_installer_path.parent().unwrap())?; if settings.windows().can_sign() { - log::info!("Signing NSIS plugins"); - for dll in NSIS_PLUGIN_FILES { - let path = additional_plugins_path.join(dll); - if path.exists() { - try_sign(&path, settings)?; - } else { - log::warn!("Could not find {}, skipping signing", path.display()); + if let Some(plugin_copy_path) = &maybe_plugin_copy_path { + let plugin_copy_path = plugin_copy_path.join("x86-unicode"); + log::info!("Signing NSIS plugins"); + for dll in NSIS_PLUGIN_FILES { + let path = plugin_copy_path.join(dll); + if path.exists() { + try_sign(&path, settings)?; + } else { + log::warn!("Could not find {}, skipping signing", path.display()); + } } } } From 251203b8963419cb3b40741767393e8f3c909ef9 Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Tue, 9 Dec 2025 18:05:12 +0800 Subject: [PATCH 14/57] fix(linux): work area returns logical rect (#14637) --- .changes/linux-workarea-logical-size.md | 6 ++++++ crates/tauri-runtime-wry/src/monitor/linux.rs | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .changes/linux-workarea-logical-size.md diff --git a/.changes/linux-workarea-logical-size.md b/.changes/linux-workarea-logical-size.md new file mode 100644 index 000000000..a151910f6 --- /dev/null +++ b/.changes/linux-workarea-logical-size.md @@ -0,0 +1,6 @@ +--- +tauri: patch:bug +tauri-runtime-wry: patch:bug +--- + +Fix `Monitor::work_area` returns logical position and size inside the `PhysicalRect` on Linux diff --git a/crates/tauri-runtime-wry/src/monitor/linux.rs b/crates/tauri-runtime-wry/src/monitor/linux.rs index 6b6a33bce..62f87eb05 100644 --- a/crates/tauri-runtime-wry/src/monitor/linux.rs +++ b/crates/tauri-runtime-wry/src/monitor/linux.rs @@ -4,14 +4,15 @@ use gtk::prelude::MonitorExt; use tao::platform::unix::MonitorHandleExtUnix; -use tauri_runtime::dpi::{PhysicalPosition, PhysicalRect, PhysicalSize}; +use tauri_runtime::dpi::{LogicalPosition, LogicalSize, PhysicalRect}; impl super::MonitorExt for tao::monitor::MonitorHandle { fn work_area(&self) -> PhysicalRect { let rect = self.gdk_monitor().workarea(); + let scale_factor = self.scale_factor(); PhysicalRect { - size: PhysicalSize::new(rect.width() as u32, rect.height() as u32), - position: PhysicalPosition::new(rect.x(), rect.y()), + size: LogicalSize::new(rect.width() as u32, rect.height() as u32).to_physical(scale_factor), + position: LogicalPosition::new(rect.x(), rect.y()).to_physical(scale_factor), } } } From 54e8d93db1278e4bd3e9e1ae57ecb4ac1b4f63cd Mon Sep 17 00:00:00 2001 From: FabianLars Date: Tue, 9 Dec 2025 12:11:53 +0100 Subject: [PATCH 15/57] ci(renovate): group worker-rs updates --- renovate.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/renovate.json b/renovate.json index 016c0c807..3f55df977 100644 --- a/renovate.json +++ b/renovate.json @@ -29,6 +29,11 @@ "https://github.com/microsoft/windows-rs", "https://github.com/wravery/webview2-rs" ] + }, + { + "description": "Group worker-rs crates", + "groupName": "worker-rs crates", + "matchSourceUrls": ["https://github.com/cloudflare/workers-rs"] } ], "postUpdateOptions": ["pnpmDedupe"] From f2e0405dc2d8bae949de6bb5e479bbf3cde401b6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 12:41:05 +0100 Subject: [PATCH 16/57] apply version updates (#14592) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .changes/bump-version-num-bigint-dig.md | 5 ----- .changes/linux-workarea-logical-size.md | 6 ------ .changes/no-sign-skip-nsis-uninstaller.md | 5 ----- .changes/nsis-plugin-sign-path.md | 5 ----- .changes/support-template-extensions.md | 5 ----- .changes/version-req-error.md | 5 ----- Cargo.lock | 16 ++++++++-------- crates/tauri-bundler/CHANGELOG.md | 15 +++++++++++++++ crates/tauri-bundler/Cargo.toml | 4 ++-- crates/tauri-cli/CHANGELOG.md | 11 +++++++++++ crates/tauri-cli/Cargo.toml | 6 +++--- crates/tauri-cli/config.schema.json | 2 +- crates/tauri-cli/metadata-v2.json | 4 ++-- crates/tauri-macos-sign/CHANGELOG.md | 6 ++++++ crates/tauri-macos-sign/Cargo.toml | 2 +- crates/tauri-runtime-wry/CHANGELOG.md | 6 ++++++ crates/tauri-runtime-wry/Cargo.toml | 2 +- .../schemas/config.schema.json | 2 +- crates/tauri/CHANGELOG.md | 10 ++++++++++ crates/tauri/Cargo.toml | 4 ++-- packages/cli/CHANGELOG.md | 6 ++++++ packages/cli/package.json | 2 +- 22 files changed, 76 insertions(+), 53 deletions(-) delete mode 100644 .changes/bump-version-num-bigint-dig.md delete mode 100644 .changes/linux-workarea-logical-size.md delete mode 100644 .changes/no-sign-skip-nsis-uninstaller.md delete mode 100644 .changes/nsis-plugin-sign-path.md delete mode 100644 .changes/support-template-extensions.md delete mode 100644 .changes/version-req-error.md diff --git a/.changes/bump-version-num-bigint-dig.md b/.changes/bump-version-num-bigint-dig.md deleted file mode 100644 index 5b7214e58..000000000 --- a/.changes/bump-version-num-bigint-dig.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"tauri-macos-sign": patch:deps ---- - -Update num-bigint-dig from 0.8.4 to 0.8.6 \ No newline at end of file diff --git a/.changes/linux-workarea-logical-size.md b/.changes/linux-workarea-logical-size.md deleted file mode 100644 index a151910f6..000000000 --- a/.changes/linux-workarea-logical-size.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -tauri: patch:bug -tauri-runtime-wry: patch:bug ---- - -Fix `Monitor::work_area` returns logical position and size inside the `PhysicalRect` on Linux diff --git a/.changes/no-sign-skip-nsis-uninstaller.md b/.changes/no-sign-skip-nsis-uninstaller.md deleted file mode 100644 index 3e7952d93..000000000 --- a/.changes/no-sign-skip-nsis-uninstaller.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -tauri-bundler: patch:bug ---- - -Skip signing for NSIS uninstaller when using `--no-sign` flag diff --git a/.changes/nsis-plugin-sign-path.md b/.changes/nsis-plugin-sign-path.md deleted file mode 100644 index 99f4f6861..000000000 --- a/.changes/nsis-plugin-sign-path.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -tauri-bundler: patch:bug ---- - -Fix NSIS plugins not being signed due to wrong path handlings diff --git a/.changes/support-template-extensions.md b/.changes/support-template-extensions.md deleted file mode 100644 index 8fa4654c9..000000000 --- a/.changes/support-template-extensions.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -tauri-bundler: patch:enhance ---- - -Consider extensions that are defined in the wxs template. diff --git a/.changes/version-req-error.md b/.changes/version-req-error.md deleted file mode 100644 index 902151b34..000000000 --- a/.changes/version-req-error.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -tauri-cli: patch:changes ---- - -Errors like `Error Failed to parse version 2 for for NPM package tauri` when there was no `package-lock.json` file present yet or when using ones like `link:./tauri` are now only logged in `--verbose` mode. diff --git a/Cargo.lock b/Cargo.lock index 407c0f444..d571d8aae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1319,7 +1319,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" dependencies = [ "lazy_static", - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] @@ -4319,7 +4319,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -8493,7 +8493,7 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tauri" -version = "2.9.4" +version = "2.9.5" dependencies = [ "anyhow", "bytes", @@ -8575,7 +8575,7 @@ dependencies = [ [[package]] name = "tauri-bundler" -version = "2.7.4" +version = "2.7.5" dependencies = [ "anyhow", "ar", @@ -8621,7 +8621,7 @@ dependencies = [ [[package]] name = "tauri-cli" -version = "2.9.5" +version = "2.9.6" dependencies = [ "ar", "axum", @@ -8781,7 +8781,7 @@ dependencies = [ [[package]] name = "tauri-macos-sign" -version = "2.3.1" +version = "2.3.2" dependencies = [ "apple-codesign", "chrono", @@ -8884,7 +8884,7 @@ dependencies = [ [[package]] name = "tauri-runtime-wry" -version = "2.9.2" +version = "2.9.3" dependencies = [ "gtk", "http 1.3.1", @@ -10323,7 +10323,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.48.0", ] [[package]] diff --git a/crates/tauri-bundler/CHANGELOG.md b/crates/tauri-bundler/CHANGELOG.md index 0ae31a2bd..c8e880524 100644 --- a/crates/tauri-bundler/CHANGELOG.md +++ b/crates/tauri-bundler/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## \[2.7.5] + +### Enhancements + +- [`4176f93ae`](https://www.github.com/tauri-apps/tauri/commit/4176f93ae43ef66714c4934feb3df19df3a3e28a) ([#14570](https://www.github.com/tauri-apps/tauri/pull/14570) by [@chfaft](https://www.github.com/tauri-apps/tauri/../../chfaft)) Consider extensions that are defined in the wxs template. + +### Bug Fixes + +- [`018b4db22`](https://www.github.com/tauri-apps/tauri/commit/018b4db22e167fa67b37b0933e192a0f3556d3e5) ([#14625](https://www.github.com/tauri-apps/tauri/pull/14625) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Skip signing for NSIS uninstaller when using `--no-sign` flag +- [`91becd9e4`](https://www.github.com/tauri-apps/tauri/commit/91becd9e4fa2db089ddc6b21dadc06133e939e08) ([#14627](https://www.github.com/tauri-apps/tauri/pull/14627) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Fix NSIS plugins not being signed due to wrong path handlings + +### Dependencies + +- Upgraded to `tauri-macos-sign@2.3.2` + ## \[2.7.4] ### Bug Fixes diff --git a/crates/tauri-bundler/Cargo.toml b/crates/tauri-bundler/Cargo.toml index 351b072ed..cb88cb9a9 100644 --- a/crates/tauri-bundler/Cargo.toml +++ b/crates/tauri-bundler/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-bundler" -version = "2.7.4" +version = "2.7.5" authors = [ "George Burton ", "Tauri Programme within The Commons Conservancy", @@ -59,7 +59,7 @@ features = ["Win32_System_SystemInformation", "Win32_System_Diagnostics_Debug"] [target."cfg(target_os = \"macos\")".dependencies] icns = { package = "tauri-icns", version = "0.1" } time = { version = "0.3", features = ["formatting"] } -tauri-macos-sign = { version = "2.3.1", path = "../tauri-macos-sign" } +tauri-macos-sign = { version = "2.3.2", path = "../tauri-macos-sign" } [target."cfg(target_os = \"linux\")".dependencies] heck = "0.5" diff --git a/crates/tauri-cli/CHANGELOG.md b/crates/tauri-cli/CHANGELOG.md index ba3f2baf5..cb3bc6716 100644 --- a/crates/tauri-cli/CHANGELOG.md +++ b/crates/tauri-cli/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## \[2.9.6] + +### What's Changed + +- [`7b1b3514d`](https://www.github.com/tauri-apps/tauri/commit/7b1b3514df771e6e9859b9f54fa4df332433948e) ([#14621](https://www.github.com/tauri-apps/tauri/pull/14621) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Errors like `Error Failed to parse version 2 for for NPM package tauri` when there was no `package-lock.json` file present yet or when using ones like `link:./tauri` are now only logged in `--verbose` mode. + +### Dependencies + +- Upgraded to `tauri-macos-sign@2.3.2` +- Upgraded to `tauri-bundler@2.7.5` + ## \[2.9.5] ### Bug Fixes diff --git a/crates/tauri-cli/Cargo.toml b/crates/tauri-cli/Cargo.toml index 89d2ead0c..cbd4bebf6 100644 --- a/crates/tauri-cli/Cargo.toml +++ b/crates/tauri-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-cli" -version = "2.9.5" +version = "2.9.6" authors = ["Tauri Programme within The Commons Conservancy"] edition = "2021" rust-version = "1.77.2" @@ -47,7 +47,7 @@ sublime_fuzzy = "0.7" clap_complete = "4" clap = { version = "4", features = ["derive", "env"] } thiserror = "2" -tauri-bundler = { version = "2.7.4", default-features = false, path = "../tauri-bundler" } +tauri-bundler = { version = "2.7.5", default-features = false, path = "../tauri-bundler" } colored = "2" serde = { version = "1", features = ["derive"] } serde_json = { version = "1", features = ["preserve_order"] } @@ -133,7 +133,7 @@ libc = "0.2" [target."cfg(target_os = \"macos\")".dependencies] plist = "1" -tauri-macos-sign = { version = "2.3.1", path = "../tauri-macos-sign" } +tauri-macos-sign = { version = "2.3.2", path = "../tauri-macos-sign" } object = { version = "0.36", default-features = false, features = [ "macho", "read_core", diff --git a/crates/tauri-cli/config.schema.json b/crates/tauri-cli/config.schema.json index c71bf6e2d..4ccf34d1b 100644 --- a/crates/tauri-cli/config.schema.json +++ b/crates/tauri-cli/config.schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://schema.tauri.app/config/2.9.4", + "$id": "https://schema.tauri.app/config/2.9.5", "title": "Config", "description": "The Tauri configuration object.\n It is read from a file where you can define your frontend assets,\n configure the bundler and define a tray icon.\n\n The configuration file is generated by the\n [`tauri init`](https://v2.tauri.app/reference/cli/#init) command that lives in\n your Tauri application source directory (src-tauri).\n\n Once generated, you may modify it at will to customize your Tauri application.\n\n ## File Formats\n\n By default, the configuration is defined as a JSON file named `tauri.conf.json`.\n\n Tauri also supports JSON5 and TOML files via the `config-json5` and `config-toml` Cargo features, respectively.\n The JSON5 file name must be either `tauri.conf.json` or `tauri.conf.json5`.\n The TOML file name is `Tauri.toml`.\n\n ## Platform-Specific Configuration\n\n In addition to the default configuration file, Tauri can\n read a platform-specific configuration from `tauri.linux.conf.json`,\n `tauri.windows.conf.json`, `tauri.macos.conf.json`, `tauri.android.conf.json` and `tauri.ios.conf.json`\n (or `Tauri.linux.toml`, `Tauri.windows.toml`, `Tauri.macos.toml`, `Tauri.android.toml` and `Tauri.ios.toml` if the `Tauri.toml` format is used),\n which gets merged with the main configuration object.\n\n ## Configuration Structure\n\n The configuration is composed of the following objects:\n\n - [`app`](#appconfig): The Tauri configuration\n - [`build`](#buildconfig): The build configuration\n - [`bundle`](#bundleconfig): The bundle configurations\n - [`plugins`](#pluginconfig): The plugins configuration\n\n Example tauri.config.json file:\n\n ```json\n {\n \"productName\": \"tauri-app\",\n \"version\": \"0.1.0\",\n \"build\": {\n \"beforeBuildCommand\": \"\",\n \"beforeDevCommand\": \"\",\n \"devUrl\": \"http://localhost:3000\",\n \"frontendDist\": \"../dist\"\n },\n \"app\": {\n \"security\": {\n \"csp\": null\n },\n \"windows\": [\n {\n \"fullscreen\": false,\n \"height\": 600,\n \"resizable\": true,\n \"title\": \"Tauri App\",\n \"width\": 800\n }\n ]\n },\n \"bundle\": {},\n \"plugins\": {}\n }\n ```", "type": "object", diff --git a/crates/tauri-cli/metadata-v2.json b/crates/tauri-cli/metadata-v2.json index b57586d4a..510949b94 100644 --- a/crates/tauri-cli/metadata-v2.json +++ b/crates/tauri-cli/metadata-v2.json @@ -1,9 +1,9 @@ { "cli.js": { - "version": "2.9.5", + "version": "2.9.6", "node": ">= 10.0.0" }, - "tauri": "2.9.4", + "tauri": "2.9.5", "tauri-build": "2.5.3", "tauri-plugin": "2.5.2" } diff --git a/crates/tauri-macos-sign/CHANGELOG.md b/crates/tauri-macos-sign/CHANGELOG.md index 6da5a62a8..6cccf2a3e 100644 --- a/crates/tauri-macos-sign/CHANGELOG.md +++ b/crates/tauri-macos-sign/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## \[2.3.2] + +### Dependencies + +- [`514cf21e1`](https://www.github.com/tauri-apps/tauri/commit/514cf21e1417c7a78a0db494f891ba79d948b73d) ([#14591](https://www.github.com/tauri-apps/tauri/pull/14591) by [@Tunglies](https://www.github.com/tauri-apps/tauri/../../Tunglies)) Update num-bigint-dig from 0.8.4 to 0.8.6 + ## \[2.3.1] ### Performance Improvements diff --git a/crates/tauri-macos-sign/Cargo.toml b/crates/tauri-macos-sign/Cargo.toml index 620c3f750..9fc874364 100644 --- a/crates/tauri-macos-sign/Cargo.toml +++ b/crates/tauri-macos-sign/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-macos-sign" -version = "2.3.1" +version = "2.3.2" authors = ["Tauri Programme within The Commons Conservancy"] license = "Apache-2.0 OR MIT" keywords = ["codesign", "signing", "macos", "ios", "tauri"] diff --git a/crates/tauri-runtime-wry/CHANGELOG.md b/crates/tauri-runtime-wry/CHANGELOG.md index 2fee3f822..76f0a046f 100644 --- a/crates/tauri-runtime-wry/CHANGELOG.md +++ b/crates/tauri-runtime-wry/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## \[2.9.3] + +### Bug Fixes + +- [`251203b89`](https://www.github.com/tauri-apps/tauri/commit/251203b8963419cb3b40741767393e8f3c909ef9) ([#14637](https://www.github.com/tauri-apps/tauri/pull/14637) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Fix `Monitor::work_area` returns logical position and size inside the `PhysicalRect` on Linux + ## \[2.9.2] ### Dependencies diff --git a/crates/tauri-runtime-wry/Cargo.toml b/crates/tauri-runtime-wry/Cargo.toml index 3284cddbd..339b07f4a 100644 --- a/crates/tauri-runtime-wry/Cargo.toml +++ b/crates/tauri-runtime-wry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri-runtime-wry" -version = "2.9.2" +version = "2.9.3" description = "Wry bindings to the Tauri runtime" exclude = ["CHANGELOG.md", "/target"] readme = "README.md" diff --git a/crates/tauri-schema-generator/schemas/config.schema.json b/crates/tauri-schema-generator/schemas/config.schema.json index c71bf6e2d..4ccf34d1b 100644 --- a/crates/tauri-schema-generator/schemas/config.schema.json +++ b/crates/tauri-schema-generator/schemas/config.schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://schema.tauri.app/config/2.9.4", + "$id": "https://schema.tauri.app/config/2.9.5", "title": "Config", "description": "The Tauri configuration object.\n It is read from a file where you can define your frontend assets,\n configure the bundler and define a tray icon.\n\n The configuration file is generated by the\n [`tauri init`](https://v2.tauri.app/reference/cli/#init) command that lives in\n your Tauri application source directory (src-tauri).\n\n Once generated, you may modify it at will to customize your Tauri application.\n\n ## File Formats\n\n By default, the configuration is defined as a JSON file named `tauri.conf.json`.\n\n Tauri also supports JSON5 and TOML files via the `config-json5` and `config-toml` Cargo features, respectively.\n The JSON5 file name must be either `tauri.conf.json` or `tauri.conf.json5`.\n The TOML file name is `Tauri.toml`.\n\n ## Platform-Specific Configuration\n\n In addition to the default configuration file, Tauri can\n read a platform-specific configuration from `tauri.linux.conf.json`,\n `tauri.windows.conf.json`, `tauri.macos.conf.json`, `tauri.android.conf.json` and `tauri.ios.conf.json`\n (or `Tauri.linux.toml`, `Tauri.windows.toml`, `Tauri.macos.toml`, `Tauri.android.toml` and `Tauri.ios.toml` if the `Tauri.toml` format is used),\n which gets merged with the main configuration object.\n\n ## Configuration Structure\n\n The configuration is composed of the following objects:\n\n - [`app`](#appconfig): The Tauri configuration\n - [`build`](#buildconfig): The build configuration\n - [`bundle`](#bundleconfig): The bundle configurations\n - [`plugins`](#pluginconfig): The plugins configuration\n\n Example tauri.config.json file:\n\n ```json\n {\n \"productName\": \"tauri-app\",\n \"version\": \"0.1.0\",\n \"build\": {\n \"beforeBuildCommand\": \"\",\n \"beforeDevCommand\": \"\",\n \"devUrl\": \"http://localhost:3000\",\n \"frontendDist\": \"../dist\"\n },\n \"app\": {\n \"security\": {\n \"csp\": null\n },\n \"windows\": [\n {\n \"fullscreen\": false,\n \"height\": 600,\n \"resizable\": true,\n \"title\": \"Tauri App\",\n \"width\": 800\n }\n ]\n },\n \"bundle\": {},\n \"plugins\": {}\n }\n ```", "type": "object", diff --git a/crates/tauri/CHANGELOG.md b/crates/tauri/CHANGELOG.md index d4b868f5e..ea3c1568c 100644 --- a/crates/tauri/CHANGELOG.md +++ b/crates/tauri/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## \[2.9.5] + +### Bug Fixes + +- [`251203b89`](https://www.github.com/tauri-apps/tauri/commit/251203b8963419cb3b40741767393e8f3c909ef9) ([#14637](https://www.github.com/tauri-apps/tauri/pull/14637) by [@Legend-Master](https://www.github.com/tauri-apps/tauri/../../Legend-Master)) Fix `Monitor::work_area` returns logical position and size inside the `PhysicalRect` on Linux + +### Dependencies + +- Upgraded to `tauri-runtime-wry@2.9.3` + ## \[2.9.4] ### Performance Improvements diff --git a/crates/tauri/Cargo.toml b/crates/tauri/Cargo.toml index 48336f82a..4da7736cd 100644 --- a/crates/tauri/Cargo.toml +++ b/crates/tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tauri" -version = "2.9.4" +version = "2.9.5" description = "Make tiny, secure apps for all desktop platforms with Tauri" exclude = ["/test", "/.scripts", "CHANGELOG.md", "/target"] readme = "README.md" @@ -60,7 +60,7 @@ tauri-macros = { version = "2.5.2", path = "../tauri-macros" } tauri-utils = { version = "2.8.1", features = [ "resources", ], path = "../tauri-utils" } -tauri-runtime-wry = { version = "2.9.2", path = "../tauri-runtime-wry", default-features = false, optional = true } +tauri-runtime-wry = { version = "2.9.3", path = "../tauri-runtime-wry", default-features = false, optional = true } getrandom = "0.3" serde_repr = "0.1" http = "1" diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 669c6b313..305a65a38 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## \[2.9.6] + +### Dependencies + +- Upgraded to `tauri-cli@2.9.6` + ## \[2.9.5] ### Bug Fixes diff --git a/packages/cli/package.json b/packages/cli/package.json index 0d2bf618c..f6dce72a9 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@tauri-apps/cli", - "version": "2.9.5", + "version": "2.9.6", "description": "Command line interface for building Tauri apps", "type": "commonjs", "funding": { From 18c69df8c771885533c324eece3004c44311aa9c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 13:42:27 +0100 Subject: [PATCH 17/57] chore(deps): update worker-rs crates to 0.7 (#14638) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: FabianLars --- Cargo.lock | 77 ++++++++---------------- crates/tauri-schema-worker/Cargo.toml | 4 +- crates/tauri-schema-worker/wrangler.toml | 3 +- 3 files changed, 28 insertions(+), 56 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d571d8aae..9dae76c32 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1319,7 +1319,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" dependencies = [ "lazy_static", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -3968,9 +3968,9 @@ checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0" [[package]] name = "js-sys" -version = "0.3.77" +version = "0.3.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +checksum = "464a3709c7f55f1f721e5389aa6ea4e3bc6aba669353300af094b29ffbdde1d8" dependencies = [ "once_cell", "wasm-bindgen", @@ -4319,7 +4319,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -10062,35 +10062,22 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +checksum = "0d759f433fa64a2d763d1340820e46e111a7a5ab75f993d1852d70b03dbb80fd" dependencies = [ "cfg-if", "once_cell", "rustversion", "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.100" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" -dependencies = [ - "bumpalo", - "log", - "proc-macro2", - "quote", - "syn 2.0.95", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.50" +version = "0.4.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +checksum = "836d9622d604feee9e5de25ac10e3ea5f2d65b41eac0d9ce72eb5deae707ce7c" dependencies = [ "cfg-if", "js-sys", @@ -10101,9 +10088,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +checksum = "48cb0d2638f8baedbc542ed444afc0644a29166f1595371af4fecf8ce1e7eeb3" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -10111,22 +10098,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +checksum = "cefb59d5cd5f92d9dcf80e4683949f15ca4b511f4ac0a6e14d4e1ac60c6ecd40" dependencies = [ + "bumpalo", "proc-macro2", "quote", "syn 2.0.95", - "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.100" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +checksum = "cbc538057e648b67f72a982e708d485b2efa771e1ac05fec311f9f63e5800db4" dependencies = [ "unicode-ident", ] @@ -10146,9 +10133,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.77" +version = "0.3.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +checksum = "9b32828d774c412041098d182a8b38b16ea816958e07cf40eec2bc080ae137ac" dependencies = [ "js-sys", "wasm-bindgen", @@ -10323,7 +10310,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -10868,9 +10855,9 @@ dependencies = [ [[package]] name = "worker" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6ac1566a3005b790b974f0621d77431e2a47e5f481276485f5ac0485775de2" +checksum = "42c76c5889873a2c309365ad4503810c007d3c25fbb4e9fa9e4e23c4ceb3c7f2" dependencies = [ "async-trait", "axum", @@ -10893,31 +10880,15 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "worker-kv", "worker-macros", "worker-sys", ] -[[package]] -name = "worker-kv" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0d30eb90e8db0657414129624c0d12c6cb480574bc2ddd584822db196cb9a52" -dependencies = [ - "js-sys", - "serde", - "serde-wasm-bindgen", - "serde_json", - "thiserror 2.0.12", - "wasm-bindgen", - "wasm-bindgen-futures", -] - [[package]] name = "worker-macros" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ba7478759843ae3d56dc7ba2445e7a514a5d043eaa98cebac2789f7ab5221ee" +checksum = "62c62584d037bad33789a6a5d605b3fccea1c52de9251d06f9d44054170dc612" dependencies = [ "async-trait", "proc-macro2", @@ -10931,9 +10902,9 @@ dependencies = [ [[package]] name = "worker-sys" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb4d7a3273dd584b9526aec77bbcf815c51d1a0e17407b1a390cf5a39b6d4fbd" +checksum = "72ddd412fd62c6eeffc1dd85e6ae5960a33b534f44a733df75b6e7519972bc74" dependencies = [ "cfg-if", "js-sys", diff --git a/crates/tauri-schema-worker/Cargo.toml b/crates/tauri-schema-worker/Cargo.toml index 70462e5f9..34da45cc7 100644 --- a/crates/tauri-schema-worker/Cargo.toml +++ b/crates/tauri-schema-worker/Cargo.toml @@ -8,8 +8,8 @@ publish = false crate-type = ["cdylib"] [dependencies] -worker = { version = "0.6", features = ['http', 'axum'] } -worker-macros = { version = "0.6", features = ['http'] } +worker = { version = "0.7", features = ['http', 'axum'] } +worker-macros = { version = "0.7", features = ['http'] } console_error_panic_hook = { version = "0.1" } axum = { version = "0.8", default-features = false } tower-service = "0.3" diff --git a/crates/tauri-schema-worker/wrangler.toml b/crates/tauri-schema-worker/wrangler.toml index c7b811908..661b6059a 100644 --- a/crates/tauri-schema-worker/wrangler.toml +++ b/crates/tauri-schema-worker/wrangler.toml @@ -7,8 +7,9 @@ main = "build/worker/shim.mjs" compatibility_date = "2023-08-23" send_metrics = false +# The minor version of worker-build must match worker/worker-macros in Cargo.toml! [build] -command = "cargo install -q worker-build && worker-build --release" +command = "cargo install -q worker-build@^0.7 && worker-build --release" [observability] enabled = true From 2d28e3143ee3d97d7570ea03877aa00a0d6e47d0 Mon Sep 17 00:00:00 2001 From: sftse Date: Tue, 9 Dec 2025 14:38:14 +0100 Subject: [PATCH 18/57] Cleanups (#14632) * refactor(tauri-utils): current_dest and current_pattern always change in-sync, group them to one Option * refactor(tauri-utils): pass path as explicit argument instead of implicitly through self * refactor(tauri-utils): remove struct field that is never set to Some * refactor(tauri-cli): use OsString, OsStr where possible * refactor(tauri-cli): Deref Arc early * refactor(tauri-cli): lock config before passing to build::setup() * refactor(tauri-build, tauri-utils): bettern pattern matching and borrowing * refactor(tauri-cli): dont need Arc if already have static * fix(tauri-cli): race condition initializing static flag, remove unnecessary OnceLock * refactor(tauri-cli): use expect * refactor(tauri-cli): remove unnecessary OnceLock * refactor(tauri-cli): better use of dunce api * refactor(tauri-cli): rename --- .changes/change-pr-14632.md | 7 +++ crates/tauri-build/src/lib.rs | 16 +++---- .../tauri-bundler/src/bundle/windows/sign.rs | 3 +- crates/tauri-cli/src/build.rs | 39 +++++++-------- crates/tauri-cli/src/bundle.rs | 4 +- crates/tauri-cli/src/dev.rs | 16 +++---- crates/tauri-cli/src/helpers/app_paths.rs | 16 ++----- crates/tauri-cli/src/helpers/config.rs | 35 +++++++------- crates/tauri-cli/src/mobile/android/build.rs | 7 ++- crates/tauri-cli/src/mobile/android/dev.rs | 2 +- crates/tauri-cli/src/mobile/ios/build.rs | 7 ++- crates/tauri-utils/src/config/parse.rs | 2 +- crates/tauri-utils/src/platform.rs | 12 ++--- crates/tauri-utils/src/resources.rs | 47 +++++-------------- 14 files changed, 89 insertions(+), 124 deletions(-) create mode 100644 .changes/change-pr-14632.md diff --git a/.changes/change-pr-14632.md b/.changes/change-pr-14632.md new file mode 100644 index 000000000..068994f0d --- /dev/null +++ b/.changes/change-pr-14632.md @@ -0,0 +1,7 @@ +--- +"tauri-utils": patch:enhance +"tauri-build": patch:enhance +"tauri-cli": patch:enhance +--- + +Small code refactors for improved code readability. No user facing changes. diff --git a/crates/tauri-build/src/lib.rs b/crates/tauri-build/src/lib.rs index cd9724252..42c9275b4 100644 --- a/crates/tauri-build/src/lib.rs +++ b/crates/tauri-build/src/lib.rs @@ -165,21 +165,21 @@ fn copy_frameworks(dest_dir: &Path, frameworks: &[String]) -> Result<()> { .with_context(|| format!("Failed to create frameworks output directory at {dest_dir:?}"))?; for framework in frameworks.iter() { if framework.ends_with(".framework") { - let src_path = PathBuf::from(framework); + let src_path = Path::new(framework); let src_name = src_path .file_name() .expect("Couldn't get framework filename"); let dest_path = dest_dir.join(src_name); - copy_dir(&src_path, &dest_path)?; + copy_dir(src_path, &dest_path)?; continue; } else if framework.ends_with(".dylib") { - let src_path = PathBuf::from(framework); + let src_path = Path::new(framework); if !src_path.exists() { return Err(anyhow::anyhow!("Library not found: {}", framework)); } let src_name = src_path.file_name().expect("Couldn't get library filename"); let dest_path = dest_dir.join(src_name); - copy_file(&src_path, &dest_path)?; + copy_file(src_path, &dest_path)?; continue; } else if framework.contains('/') { return Err(anyhow::anyhow!( @@ -192,12 +192,8 @@ fn copy_frameworks(dest_dir: &Path, frameworks: &[String]) -> Result<()> { continue; } } - if copy_framework_from(&PathBuf::from("/Library/Frameworks/"), framework, dest_dir)? - || copy_framework_from( - &PathBuf::from("/Network/Library/Frameworks/"), - framework, - dest_dir, - )? + if copy_framework_from("/Library/Frameworks/".as_ref(), framework, dest_dir)? + || copy_framework_from("/Network/Library/Frameworks/".as_ref(), framework, dest_dir)? { continue; } diff --git a/crates/tauri-bundler/src/bundle/windows/sign.rs b/crates/tauri-bundler/src/bundle/windows/sign.rs index 04e5a2da5..f7c7ad1e2 100644 --- a/crates/tauri-bundler/src/bundle/windows/sign.rs +++ b/crates/tauri-bundler/src/bundle/windows/sign.rs @@ -266,8 +266,7 @@ pub fn try_sign>(file_path: P, settings: &Settings) -> crate::Res pub fn should_sign(file_path: &Path) -> crate::Result { let is_binary = file_path .extension() - .and_then(|extension| extension.to_str()) - .is_some_and(|extension| matches!(extension, "exe" | "dll")); + .is_some_and(|ext| ext == "exe" || ext == "dll"); if !is_binary { return Ok(false); } diff --git a/crates/tauri-cli/src/build.rs b/crates/tauri-cli/src/build.rs index 12accb16f..ac8c5552a 100644 --- a/crates/tauri-cli/src/build.rs +++ b/crates/tauri-cli/src/build.rs @@ -8,7 +8,7 @@ use crate::{ helpers::{ self, app_paths::{frontend_dir, tauri_dir}, - config::{get as get_config, ConfigHandle, FrontendDist}, + config::{get as get_config, ConfigMetadata, FrontendDist}, }, info::plugins::check_mismatched_packages, interface::{rust::get_cargo_target_dir, AppInterface, Interface}, @@ -106,11 +106,11 @@ pub fn command(mut options: Options, verbosity: u8) -> Result<()> { options.target.clone(), )?; - setup(&interface, &mut options, config.clone(), false)?; - let config_guard = config.lock().unwrap(); let config_ = config_guard.as_ref().unwrap(); + setup(&interface, &mut options, config_, false)?; + if let Some(minimum_system_version) = &config_.bundle.macos.minimum_system_version { std::env::set_var("MACOSX_DEPLOYMENT_TARGET", minimum_system_version); } @@ -132,7 +132,7 @@ pub fn command(mut options: Options, verbosity: u8) -> Result<()> { verbosity, ci, &interface, - &app_settings, + &*app_settings, config_, &out_dir, )?; @@ -144,7 +144,7 @@ pub fn command(mut options: Options, verbosity: u8) -> Result<()> { pub fn setup( interface: &AppInterface, options: &mut Options, - config: ConfigHandle, + config: &ConfigMetadata, mobile: bool, ) -> Result<()> { let tauri_path = tauri_dir(); @@ -162,44 +162,39 @@ pub fn setup( set_current_dir(tauri_path).context("failed to set current directory")?; - let config_guard = config.lock().unwrap(); - let config_ = config_guard.as_ref().unwrap(); - - let bundle_identifier_source = config_ + let bundle_identifier_source = config .find_bundle_identifier_overwriter() .unwrap_or_else(|| "tauri.conf.json".into()); - if config_.identifier == "com.tauri.dev" { + if config.identifier == "com.tauri.dev" { crate::error::bail!( "You must change the bundle identifier in `{bundle_identifier_source} identifier`. The default value `com.tauri.dev` is not allowed as it must be unique across applications.", ); } - if config_ + if config .identifier .chars() .any(|ch| !(ch.is_alphanumeric() || ch == '-' || ch == '.')) { crate::error::bail!( - "The bundle identifier \"{}\" set in `{} identifier`. The bundle identifier string must contain only alphanumeric characters (A-Z, a-z, and 0-9), hyphens (-), and periods (.).", - config_.identifier, - bundle_identifier_source + "The bundle identifier \"{}\" set in `{bundle_identifier_source:?} identifier`. The bundle identifier string must contain only alphanumeric characters (A-Z, a-z, and 0-9), hyphens (-), and periods (.).", + config.identifier, ); } - if config_.identifier.ends_with(".app") { + if config.identifier.ends_with(".app") { log::warn!( - "The bundle identifier \"{}\" set in `{} identifier` ends with `.app`. This is not recommended because it conflicts with the application bundle extension on macOS.", - config_.identifier, - bundle_identifier_source + "The bundle identifier \"{}\" set in `{bundle_identifier_source:?} identifier` ends with `.app`. This is not recommended because it conflicts with the application bundle extension on macOS.", + config.identifier, ); } - if let Some(before_build) = config_.build.before_build_command.clone() { + if let Some(before_build) = config.build.before_build_command.clone() { helpers::run_hook("beforeBuildCommand", before_build, interface, options.debug)?; } - if let Some(FrontendDist::Directory(web_asset_path)) = &config_.build.frontend_dist { + if let Some(FrontendDist::Directory(web_asset_path)) = &config.build.frontend_dist { if !web_asset_path.exists() { let absolute_path = web_asset_path .parent() @@ -252,13 +247,13 @@ pub fn setup( } if options.runner.is_none() { - options.runner = config_.build.runner.clone(); + options.runner = config.build.runner.clone(); } options .features .get_or_insert(Vec::new()) - .extend(config_.build.features.clone().unwrap_or_default()); + .extend(config.build.features.clone().unwrap_or_default()); interface.build_options(&mut options.args, &mut options.features, mobile); Ok(()) diff --git a/crates/tauri-cli/src/bundle.rs b/crates/tauri-cli/src/bundle.rs index 890386cd7..646f44ddb 100644 --- a/crates/tauri-cli/src/bundle.rs +++ b/crates/tauri-cli/src/bundle.rs @@ -158,7 +158,7 @@ pub fn command(options: Options, verbosity: u8) -> crate::Result<()> { verbosity, ci, &interface, - &app_settings, + &*app_settings, config_, &out_dir, ) @@ -170,7 +170,7 @@ pub fn bundle( verbosity: u8, ci: bool, interface: &AppInterface, - app_settings: &std::sync::Arc, + app_settings: &A, config: &ConfigMetadata, out_dir: &Path, ) -> crate::Result<()> { diff --git a/crates/tauri-cli/src/dev.rs b/crates/tauri-cli/src/dev.rs index 9179e9cfd..7ebabb458 100644 --- a/crates/tauri-cli/src/dev.rs +++ b/crates/tauri-cli/src/dev.rs @@ -34,7 +34,7 @@ use std::{ mod builtin_dev_server; static BEFORE_DEV: OnceLock>> = OnceLock::new(); -static KILL_BEFORE_DEV_FLAG: OnceLock = OnceLock::new(); +static KILL_BEFORE_DEV_FLAG: AtomicBool = AtomicBool::new(false); #[cfg(unix)] const KILL_CHILDREN_SCRIPT: &[u8] = include_bytes!("../scripts/kill-children.sh"); @@ -218,14 +218,13 @@ pub fn setup(interface: &AppInterface, options: &mut Options, config: ConfigHand let status = child_ .wait() .expect("failed to wait on \"beforeDevCommand\""); - if !(status.success() || KILL_BEFORE_DEV_FLAG.get().unwrap().load(Ordering::Relaxed)) { + if !(status.success() || KILL_BEFORE_DEV_FLAG.load(Ordering::Relaxed)) { log::error!("The \"beforeDevCommand\" terminated with a non-zero status code."); exit(status.code().unwrap_or(1)); } }); BEFORE_DEV.set(Mutex::new(child)).unwrap(); - KILL_BEFORE_DEV_FLAG.set(AtomicBool::default()).unwrap(); let _ = ctrlc::set_handler(move || { kill_before_dev_process(); @@ -304,12 +303,10 @@ pub fn setup(interface: &AppInterface, options: &mut Options, config: ConfigHand if !options.no_dev_server_wait { if let Some(url) = dev_url { - let host = url - .host() - .unwrap_or_else(|| panic!("No host name in the URL")); + let host = url.host().expect("No host name in the URL"); let port = url .port_or_known_default() - .unwrap_or_else(|| panic!("No port number in the URL")); + .expect("No port number in the URL"); let addrs; let addr; let addrs = match host { @@ -380,11 +377,10 @@ pub fn on_app_exit(code: Option, reason: ExitReason, exit_on_panic: bool, n pub fn kill_before_dev_process() { if let Some(child) = BEFORE_DEV.get() { let child = child.lock().unwrap(); - let kill_before_dev_flag = KILL_BEFORE_DEV_FLAG.get().unwrap(); - if kill_before_dev_flag.load(Ordering::Relaxed) { + if KILL_BEFORE_DEV_FLAG.load(Ordering::Relaxed) { return; } - kill_before_dev_flag.store(true, Ordering::Relaxed); + KILL_BEFORE_DEV_FLAG.store(true, Ordering::Relaxed); #[cfg(windows)] { let powershell_path = std::env::var("SYSTEMROOT").map_or_else( diff --git a/crates/tauri-cli/src/helpers/app_paths.rs b/crates/tauri-cli/src/helpers/app_paths.rs index 1bf1ef9b5..3c728f5ba 100644 --- a/crates/tauri-cli/src/helpers/app_paths.rs +++ b/crates/tauri-cli/src/helpers/app_paths.rs @@ -75,21 +75,13 @@ fn lookup bool>(dir: &Path, checker: F) -> Option { } fn env_tauri_app_path() -> Option { - std::env::var(ENV_TAURI_APP_PATH) - .map(PathBuf::from) - .ok()? - .canonicalize() - .ok() - .map(|p| dunce::simplified(&p).to_path_buf()) + let p = PathBuf::from(std::env::var_os(ENV_TAURI_APP_PATH)?); + dunce::canonicalize(p).ok() } fn env_tauri_frontend_path() -> Option { - std::env::var(ENV_TAURI_FRONTEND_PATH) - .map(PathBuf::from) - .ok()? - .canonicalize() - .ok() - .map(|p| dunce::simplified(&p).to_path_buf()) + let p = PathBuf::from(std::env::var_os(ENV_TAURI_FRONTEND_PATH)?); + dunce::canonicalize(p).ok() } pub fn resolve_tauri_dir() -> Option { diff --git a/crates/tauri-cli/src/helpers/config.rs b/crates/tauri-cli/src/helpers/config.rs index f21ce4a4b..d25c29d4f 100644 --- a/crates/tauri-cli/src/helpers/config.rs +++ b/crates/tauri-cli/src/helpers/config.rs @@ -12,9 +12,9 @@ pub use tauri_utils::{config::*, platform::Target}; use std::{ collections::HashMap, env::{current_dir, set_current_dir, set_var}, - ffi::OsStr, + ffi::{OsStr, OsString}, process::exit, - sync::{Arc, Mutex, OnceLock}, + sync::Mutex, }; use crate::error::Context; @@ -30,7 +30,7 @@ pub struct ConfigMetadata { inner: Config, /// The config extensions (platform-specific config files or the config CLI argument). /// Maps the extension name to its value. - extensions: HashMap, + extensions: HashMap, } impl std::ops::Deref for ConfigMetadata { @@ -50,7 +50,7 @@ impl ConfigMetadata { } /// Checks which config is overwriting the bundle identifier. - pub fn find_bundle_identifier_overwriter(&self) -> Option { + pub fn find_bundle_identifier_overwriter(&self) -> Option { for (ext, config) in &self.extensions { if let Some(identifier) = config .as_object() @@ -66,7 +66,7 @@ impl ConfigMetadata { } } -pub type ConfigHandle = Arc>>; +pub type ConfigHandle = &'static Mutex>; pub fn wix_settings(config: WixConfig) -> tauri_bundler::WixSettings { tauri_bundler::WixSettings { @@ -141,9 +141,9 @@ pub fn custom_sign_settings( } } -fn config_handle() -> &'static ConfigHandle { - static CONFIG_HANDLE: OnceLock = OnceLock::new(); - CONFIG_HANDLE.get_or_init(Default::default) +fn config_handle() -> ConfigHandle { + static CONFIG_HANDLE: Mutex> = Mutex::new(None); + &CONFIG_HANDLE } /// Gets the static parsed config from `tauri.conf.json`. @@ -153,14 +153,14 @@ fn get_internal( target: Target, ) -> crate::Result { if !reload && config_handle().lock().unwrap().is_some() { - return Ok(config_handle().clone()); + return Ok(config_handle()); } let tauri_dir = super::app_paths::tauri_dir(); let (mut config, config_path) = tauri_utils::config::parse::parse_value(target, tauri_dir.join("tauri.conf.json")) .context("failed to parse config")?; - let config_file_name = config_path.file_name().unwrap().to_string_lossy(); + let config_file_name = config_path.file_name().unwrap(); let mut extensions = HashMap::new(); let original_identifier = config @@ -174,10 +174,7 @@ fn get_internal( .context("failed to parse platform config")? { merge(&mut config, &platform_config); - extensions.insert( - config_path.file_name().unwrap().to_str().unwrap().into(), - platform_config, - ); + extensions.insert(config_path.file_name().unwrap().into(), platform_config); } if !merge_configs.is_empty() { @@ -203,9 +200,9 @@ fn get_internal( for error in errors { let path = error.instance_path.into_iter().join(" > "); if path.is_empty() { - log::error!("`{}` error: {}", config_file_name, error); + log::error!("`{config_file_name:?}` error: {}", error); } else { - log::error!("`{}` error on `{}`: {}", config_file_name, path, error); + log::error!("`{config_file_name:?}` error on `{}`: {}", path, error); } } if !reload { @@ -243,7 +240,7 @@ fn get_internal( extensions, }); - Ok(config_handle().clone()) + Ok(config_handle()) } pub fn get(target: Target, merge_configs: &[&serde_json::Value]) -> crate::Result { @@ -268,7 +265,7 @@ pub fn merge_with(merge_configs: &[&serde_json::Value]) -> crate::Result crate::Result Result) -> bool { let path = path.into(); - let source_file_name = path.file_name().unwrap().to_str().unwrap(); + let source_file_name = path.file_name().unwrap(); let lookup_platform_config = ENABLED_FORMATS .iter() .any(|format| source_file_name == format.into_platform_file_name(target)); diff --git a/crates/tauri-utils/src/platform.rs b/crates/tauri-utils/src/platform.rs index 542cea53c..2ace45790 100644 --- a/crates/tauri-utils/src/platform.rs +++ b/crates/tauri-utils/src/platform.rs @@ -238,16 +238,12 @@ const CARGO_OUTPUT_DIRECTORIES: &[&str] = &["debug", "release", "custom-profile" #[cfg(test)] fn is_cargo_output_directory(path: &std::path::Path) -> bool { - let last_component = path - .components() - .next_back() - .unwrap() - .as_os_str() - .to_str() - .unwrap(); + let Some(last_component) = path.components().next_back() else { + return false; + }; CARGO_OUTPUT_DIRECTORIES .iter() - .any(|dirname| &last_component == dirname) + .any(|dirname| &last_component.as_os_str() == dirname) } /// Computes the resource directory of the current environment. diff --git a/crates/tauri-utils/src/resources.rs b/crates/tauri-utils/src/resources.rs index 58a07d265..dfba0746c 100644 --- a/crates/tauri-utils/src/resources.rs +++ b/crates/tauri-utils/src/resources.rs @@ -97,9 +97,7 @@ impl<'a> ResourcePaths<'a> { iter: ResourcePathsIter { pattern_iter: PatternIter::Slice(patterns.iter()), allow_walk, - current_path: None, current_pattern: None, - current_dest: None, walk_iter: None, glob_iter: None, }, @@ -112,9 +110,7 @@ impl<'a> ResourcePaths<'a> { iter: ResourcePathsIter { pattern_iter: PatternIter::Map(patterns.iter()), allow_walk, - current_path: None, current_pattern: None, - current_dest: None, walk_iter: None, glob_iter: None, }, @@ -136,13 +132,9 @@ pub struct ResourcePathsIter<'a> { /// whether the resource paths allows directories or not. allow_walk: bool, - current_path: Option, - /// The key of map when `pattern_iter` is a [`PatternIter::Map`], + /// The (key, value) of map when `pattern_iter` is a [`PatternIter::Map`], /// used for determining [`Resource::target`] - current_pattern: Option, - /// The value of the map when `pattern_iter` is a [`PatternIter::Map`], - /// used for determining [`Resource::target`] - current_dest: Option, + current_pattern: Option<(String, PathBuf)>, walk_iter: Option, glob_iter: Option, @@ -157,8 +149,7 @@ impl ResourcePathsIter<'_> { Err(err) => return Some(Err(err.into())), }; - self.current_path = Some(normalize(&entry)); - self.next_current_path() + self.next_current_path(normalize(&entry)) } fn next_walk_iter(&mut self) -> Option> { @@ -169,8 +160,7 @@ impl ResourcePathsIter<'_> { Err(err) => return Some(Err(err.into())), }; - self.current_path = Some(normalize(entry.path())); - self.next_current_path() + self.next_current_path(normalize(entry.path())) } fn resource_from_path(&mut self, path: &Path) -> crate::Result { @@ -180,12 +170,11 @@ impl ResourcePathsIter<'_> { Ok(Resource { path: path.to_path_buf(), - target: if let Some(current_dest) = &self.current_dest { + target: if let Some((pattern, dest)) = &self.current_pattern { // if processing a directory, preserve directory structure under current_dest if self.walk_iter.is_some() { - let current_pattern = self.current_pattern.as_ref().unwrap(); - current_dest.join(path.strip_prefix(current_pattern).unwrap_or(path)) - } else if current_dest.components().count() == 0 { + dest.join(path.strip_prefix(pattern).unwrap_or(path)) + } else if dest.components().count() == 0 { // if current_dest is empty while processing a file pattern or glob // we preserve the file name as it is PathBuf::from(path.file_name().unwrap()) @@ -193,9 +182,9 @@ impl ResourcePathsIter<'_> { // if processing a glob and current_dest is not empty // we put all globbed paths under current_dest // preserving the file name as it is - current_dest.join(path.file_name().unwrap()) + dest.join(path.file_name().unwrap()) } else { - current_dest.clone() + dest.clone() } } else { // If `pattern_iter` is a [`PatternIter::Slice`] @@ -204,11 +193,7 @@ impl ResourcePathsIter<'_> { }) } - fn next_current_path(&mut self) -> Option> { - // should be safe to unwrap since every call to `self.next_current_path()` - // is preceded with assignment to `self.current_path` - let path = self.current_path.take().unwrap(); - + fn next_current_path(&mut self, path: PathBuf) -> Option> { let is_dir = path.is_dir(); if is_dir { @@ -238,15 +223,12 @@ impl ResourcePathsIter<'_> { fn next_pattern(&mut self) -> Option> { self.current_pattern = None; - self.current_dest = None; - self.current_path = None; let pattern = match &mut self.pattern_iter { PatternIter::Slice(iter) => iter.next()?, PatternIter::Map(iter) => { let (pattern, dest) = iter.next()?; - self.current_pattern = Some(pattern.clone()); - self.current_dest = Some(resource_relpath(Path::new(dest))); + self.current_pattern = Some((pattern.clone(), resource_relpath(Path::new(dest)))); pattern } }; @@ -265,8 +247,7 @@ impl ResourcePathsIter<'_> { } } - self.current_path = Some(normalize(Path::new(pattern))); - self.next_current_path() + self.next_current_path(normalize(Path::new(pattern))) } } @@ -282,10 +263,6 @@ impl Iterator for ResourcePathsIter<'_> { type Item = crate::Result; fn next(&mut self) -> Option> { - if self.current_path.is_some() { - return self.next_current_path(); - } - if self.walk_iter.is_some() { match self.next_walk_iter() { Some(r) => return Some(r), From ff5d76ca214b94a7b6e88aa4f0f797bbf747824d Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Sun, 14 Dec 2025 16:21:44 +0800 Subject: [PATCH 19/57] fix: default `WindowConfig::focus` to false in `Default::default` (#14653) --- .changes/window-config-focus-default-true.md | 5 +++++ crates/tauri-cli/config.schema.json | 2 +- .../schemas/config.schema.json | 2 +- crates/tauri-utils/src/config.rs | 12 ++++++++++-- 4 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 .changes/window-config-focus-default-true.md diff --git a/.changes/window-config-focus-default-true.md b/.changes/window-config-focus-default-true.md new file mode 100644 index 000000000..38d24aebc --- /dev/null +++ b/.changes/window-config-focus-default-true.md @@ -0,0 +1,5 @@ +--- +tauri: patch:bug +--- + +`WindowConfig::focus` is set to `false` in `WindowConfig::default()` diff --git a/crates/tauri-cli/config.schema.json b/crates/tauri-cli/config.schema.json index 4ccf34d1b..148379e83 100644 --- a/crates/tauri-cli/config.schema.json +++ b/crates/tauri-cli/config.schema.json @@ -231,7 +231,7 @@ "type": "string" }, "create": { - "description": "Whether Tauri should create this window at app startup or not.\n\n When this is set to `false` you must manually grab the config object via `app.config().app.windows`\n and create it with [`WebviewWindowBuilder::from_config`](https://docs.rs/tauri/2/tauri/webview/struct.WebviewWindowBuilder.html#method.from_config).\n\n ## Example:\n\n ```rust\n tauri::Builder::default()\n .setup(|app| {\n tauri::WebviewWindowBuilder::from_config(app.handle(), app.config().app.windows[0])?.build()?;\n Ok(())\n });\n ```", + "description": "Whether Tauri should create this window at app startup or not.\n\n When this is set to `false` you must manually grab the config object via `app.config().app.windows`\n and create it with [`WebviewWindowBuilder::from_config`](https://docs.rs/tauri/2/tauri/webview/struct.WebviewWindowBuilder.html#method.from_config).\n\n ## Example:\n\n ```rust\n tauri::Builder::default()\n .setup(|app| {\n tauri::WebviewWindowBuilder::from_config(app.handle(), &app.config().app.windows[0])?.build()?;\n Ok(())\n });\n ```", "default": true, "type": "boolean" }, diff --git a/crates/tauri-schema-generator/schemas/config.schema.json b/crates/tauri-schema-generator/schemas/config.schema.json index 4ccf34d1b..148379e83 100644 --- a/crates/tauri-schema-generator/schemas/config.schema.json +++ b/crates/tauri-schema-generator/schemas/config.schema.json @@ -231,7 +231,7 @@ "type": "string" }, "create": { - "description": "Whether Tauri should create this window at app startup or not.\n\n When this is set to `false` you must manually grab the config object via `app.config().app.windows`\n and create it with [`WebviewWindowBuilder::from_config`](https://docs.rs/tauri/2/tauri/webview/struct.WebviewWindowBuilder.html#method.from_config).\n\n ## Example:\n\n ```rust\n tauri::Builder::default()\n .setup(|app| {\n tauri::WebviewWindowBuilder::from_config(app.handle(), app.config().app.windows[0])?.build()?;\n Ok(())\n });\n ```", + "description": "Whether Tauri should create this window at app startup or not.\n\n When this is set to `false` you must manually grab the config object via `app.config().app.windows`\n and create it with [`WebviewWindowBuilder::from_config`](https://docs.rs/tauri/2/tauri/webview/struct.WebviewWindowBuilder.html#method.from_config).\n\n ## Example:\n\n ```rust\n tauri::Builder::default()\n .setup(|app| {\n tauri::WebviewWindowBuilder::from_config(app.handle(), &app.config().app.windows[0])?.build()?;\n Ok(())\n });\n ```", "default": true, "type": "boolean" }, diff --git a/crates/tauri-utils/src/config.rs b/crates/tauri-utils/src/config.rs index c90dc3e59..24b111830 100644 --- a/crates/tauri-utils/src/config.rs +++ b/crates/tauri-utils/src/config.rs @@ -1653,7 +1653,7 @@ pub struct WindowConfig { /// ```rust /// tauri::Builder::default() /// .setup(|app| { - /// tauri::WebviewWindowBuilder::from_config(app.handle(), app.config().app.windows[0])?.build()?; + /// tauri::WebviewWindowBuilder::from_config(app.handle(), &app.config().app.windows[0])?.build()?; /// Ok(()) /// }); /// ``` @@ -2006,7 +2006,7 @@ impl Default for WindowConfig { closable: true, title: default_title(), fullscreen: false, - focus: false, + focus: true, focusable: true, transparent: false, maximized: false, @@ -4384,4 +4384,12 @@ mod test { assert!(object_json.contains("\"cwd\":null") || !object_json.contains("cwd")); assert!(object_json.contains("\"args\":null") || !object_json.contains("args")); } + + #[test] + fn window_config_default_same_as_deserialize() { + let config_from_deserialization: WindowConfig = serde_json::from_str("{}").unwrap(); + let config_from_default: WindowConfig = WindowConfig::default(); + + assert_eq!(config_from_deserialization, config_from_default); + } } From b79386010d2be0a92d7109231314a1e3a6256bfc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 18 Dec 2025 22:49:52 +0800 Subject: [PATCH 20/57] chore(deps): update dependency rollup to v4.53.4 (#14670) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- packages/api/package.json | 2 +- pnpm-lock.yaml | 206 +++++++++++++++++++------------------- 2 files changed, 104 insertions(+), 104 deletions(-) diff --git a/packages/api/package.json b/packages/api/package.json index bc7aba711..930142eb2 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -55,7 +55,7 @@ "eslint-plugin-security": "3.0.1", "fast-glob": "3.3.3", "globals": "^16.2.0", - "rollup": "4.53.3", + "rollup": "4.53.4", "tslib": "^2.8.1", "typescript": "^5.8.3", "typescript-eslint": "^8.34.1" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c0f85ced8..e273bc3dd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -63,10 +63,10 @@ importers: version: 9.29.0 '@rollup/plugin-terser': specifier: 0.4.4 - version: 0.4.4(rollup@4.53.3) + version: 0.4.4(rollup@4.53.4) '@rollup/plugin-typescript': specifier: 12.3.0 - version: 12.3.0(rollup@4.53.3)(tslib@2.8.1)(typescript@5.8.3) + version: 12.3.0(rollup@4.53.4)(tslib@2.8.1)(typescript@5.8.3) '@types/eslint': specifier: ^9.6.1 version: 9.6.1 @@ -89,8 +89,8 @@ importers: specifier: ^16.2.0 version: 16.2.0 rollup: - specifier: 4.53.3 - version: 4.53.3 + specifier: 4.53.4 + version: 4.53.4 tslib: specifier: ^2.8.1 version: 2.8.1 @@ -1125,113 +1125,113 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.53.3': - resolution: {integrity: sha512-mRSi+4cBjrRLoaal2PnqH82Wqyb+d3HsPUN/W+WslCXsZsyHa9ZeQQX/pQsZaVIWDkPcpV6jJ+3KLbTbgnwv8w==} + '@rollup/rollup-android-arm-eabi@4.53.4': + resolution: {integrity: sha512-PWU3Y92H4DD0bOqorEPp1Y0tbzwAurFmIYpjcObv5axGVOtcTlB0b2UKMd2echo08MgN7jO8WQZSSysvfisFSQ==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.53.3': - resolution: {integrity: sha512-CbDGaMpdE9sh7sCmTrTUyllhrg65t6SwhjlMJsLr+J8YjFuPmCEjbBSx4Z/e4SmDyH3aB5hGaJUP2ltV/vcs4w==} + '@rollup/rollup-android-arm64@4.53.4': + resolution: {integrity: sha512-Gw0/DuVm3rGsqhMGYkSOXXIx20cC3kTlivZeuaGt4gEgILivykNyBWxeUV5Cf2tDA2nPLah26vq3emlRrWVbng==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.53.3': - resolution: {integrity: sha512-Nr7SlQeqIBpOV6BHHGZgYBuSdanCXuw09hon14MGOLGmXAFYjx1wNvquVPmpZnl0tLjg25dEdr4IQ6GgyToCUA==} + '@rollup/rollup-darwin-arm64@4.53.4': + resolution: {integrity: sha512-+w06QvXsgzKwdVg5qRLZpTHh1bigHZIqoIUPtiqh05ZiJVUQ6ymOxaPkXTvRPRLH88575ZCRSRM3PwIoNma01Q==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.53.3': - resolution: {integrity: sha512-DZ8N4CSNfl965CmPktJ8oBnfYr3F8dTTNBQkRlffnUarJ2ohudQD17sZBa097J8xhQ26AwhHJ5mvUyQW8ddTsQ==} + '@rollup/rollup-darwin-x64@4.53.4': + resolution: {integrity: sha512-EB4Na9G2GsrRNRNFPuxfwvDRDUwQEzJPpiK1vo2zMVhEeufZ1k7J1bKnT0JYDfnPC7RNZ2H5YNQhW6/p2QKATw==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.53.3': - resolution: {integrity: sha512-yMTrCrK92aGyi7GuDNtGn2sNW+Gdb4vErx4t3Gv/Tr+1zRb8ax4z8GWVRfr3Jw8zJWvpGHNpss3vVlbF58DZ4w==} + '@rollup/rollup-freebsd-arm64@4.53.4': + resolution: {integrity: sha512-bldA8XEqPcs6OYdknoTMaGhjytnwQ0NClSPpWpmufOuGPN5dDmvIa32FygC2gneKK4A1oSx86V1l55hyUWUYFQ==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.53.3': - resolution: {integrity: sha512-lMfF8X7QhdQzseM6XaX0vbno2m3hlyZFhwcndRMw8fbAGUGL3WFMBdK0hbUBIUYcEcMhVLr1SIamDeuLBnXS+Q==} + '@rollup/rollup-freebsd-x64@4.53.4': + resolution: {integrity: sha512-3T8GPjH6mixCd0YPn0bXtcuSXi1Lj+15Ujw2CEb7dd24j9thcKscCf88IV7n76WaAdorOzAgSSbuVRg4C8V8Qw==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.53.3': - resolution: {integrity: sha512-k9oD15soC/Ln6d2Wv/JOFPzZXIAIFLp6B+i14KhxAfnq76ajt0EhYc5YPeX6W1xJkAdItcVT+JhKl1QZh44/qw==} + '@rollup/rollup-linux-arm-gnueabihf@4.53.4': + resolution: {integrity: sha512-UPMMNeC4LXW7ZSHxeP3Edv09aLsFUMaD1TSVW6n1CWMECnUIJMFFB7+XC2lZTdPtvB36tYC0cJWc86mzSsaviw==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.53.3': - resolution: {integrity: sha512-vTNlKq+N6CK/8UktsrFuc+/7NlEYVxgaEgRXVUVK258Z5ymho29skzW1sutgYjqNnquGwVUObAaxae8rZ6YMhg==} + '@rollup/rollup-linux-arm-musleabihf@4.53.4': + resolution: {integrity: sha512-H8uwlV0otHs5Q7WAMSoyvjV9DJPiy5nJ/xnHolY0QptLPjaSsuX7tw+SPIfiYH6cnVx3fe4EWFafo6gH6ekZKA==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.53.3': - resolution: {integrity: sha512-RGrFLWgMhSxRs/EWJMIFM1O5Mzuz3Xy3/mnxJp/5cVhZ2XoCAxJnmNsEyeMJtpK+wu0FJFWz+QF4mjCA7AUQ3w==} + '@rollup/rollup-linux-arm64-gnu@4.53.4': + resolution: {integrity: sha512-BLRwSRwICXz0TXkbIbqJ1ibK+/dSBpTJqDClF61GWIrxTXZWQE78ROeIhgl5MjVs4B4gSLPCFeD4xML9vbzvCQ==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.53.3': - resolution: {integrity: sha512-kASyvfBEWYPEwe0Qv4nfu6pNkITLTb32p4yTgzFCocHnJLAHs+9LjUu9ONIhvfT/5lv4YS5muBHyuV84epBo/A==} + '@rollup/rollup-linux-arm64-musl@4.53.4': + resolution: {integrity: sha512-6bySEjOTbmVcPJAywjpGLckK793A0TJWSbIa0sVwtVGfe/Nz6gOWHOwkshUIAp9j7wg2WKcA4Snu7Y1nUZyQew==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-loong64-gnu@4.53.3': - resolution: {integrity: sha512-JiuKcp2teLJwQ7vkJ95EwESWkNRFJD7TQgYmCnrPtlu50b4XvT5MOmurWNrCj3IFdyjBQ5p9vnrX4JM6I8OE7g==} + '@rollup/rollup-linux-loong64-gnu@4.53.4': + resolution: {integrity: sha512-U0ow3bXYJZ5MIbchVusxEycBw7bO6C2u5UvD31i5IMTrnt2p4Fh4ZbHSdc/31TScIJQYHwxbj05BpevB3201ug==} cpu: [loong64] os: [linux] - '@rollup/rollup-linux-ppc64-gnu@4.53.3': - resolution: {integrity: sha512-EoGSa8nd6d3T7zLuqdojxC20oBfNT8nexBbB/rkxgKj5T5vhpAQKKnD+h3UkoMuTyXkP5jTjK/ccNRmQrPNDuw==} + '@rollup/rollup-linux-ppc64-gnu@4.53.4': + resolution: {integrity: sha512-iujDk07ZNwGLVn0YIWM80SFN039bHZHCdCCuX9nyx3Jsa2d9V/0Y32F+YadzwbvDxhSeVo9zefkoPnXEImnM5w==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.53.3': - resolution: {integrity: sha512-4s+Wped2IHXHPnAEbIB0YWBv7SDohqxobiiPA1FIWZpX+w9o2i4LezzH/NkFUl8LRci/8udci6cLq+jJQlh+0g==} + '@rollup/rollup-linux-riscv64-gnu@4.53.4': + resolution: {integrity: sha512-MUtAktiOUSu+AXBpx1fkuG/Bi5rhlorGs3lw5QeJ2X3ziEGAq7vFNdWVde6XGaVqi0LGSvugwjoxSNJfHFTC0g==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-riscv64-musl@4.53.3': - resolution: {integrity: sha512-68k2g7+0vs2u9CxDt5ktXTngsxOQkSEV/xBbwlqYcUrAVh6P9EgMZvFsnHy4SEiUl46Xf0IObWVbMvPrr2gw8A==} + '@rollup/rollup-linux-riscv64-musl@4.53.4': + resolution: {integrity: sha512-btm35eAbDfPtcFEgaXCI5l3c2WXyzwiE8pArhd66SDtoLWmgK5/M7CUxmUglkwtniPzwvWioBKKl6IXLbPf2sQ==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.53.3': - resolution: {integrity: sha512-VYsFMpULAz87ZW6BVYw3I6sWesGpsP9OPcyKe8ofdg9LHxSbRMd7zrVrr5xi/3kMZtpWL/wC+UIJWJYVX5uTKg==} + '@rollup/rollup-linux-s390x-gnu@4.53.4': + resolution: {integrity: sha512-uJlhKE9ccUTCUlK+HUz/80cVtx2RayadC5ldDrrDUFaJK0SNb8/cCmC9RhBhIWuZ71Nqj4Uoa9+xljKWRogdhA==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.53.3': - resolution: {integrity: sha512-3EhFi1FU6YL8HTUJZ51imGJWEX//ajQPfqWLI3BQq4TlvHy4X0MOr5q3D2Zof/ka0d5FNdPwZXm3Yyib/UEd+w==} + '@rollup/rollup-linux-x64-gnu@4.53.4': + resolution: {integrity: sha512-jjEMkzvASQBbzzlzf4os7nzSBd/cvPrpqXCUOqoeCh1dQ4BP3RZCJk8XBeik4MUln3m+8LeTJcY54C/u8wb3DQ==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.53.3': - resolution: {integrity: sha512-eoROhjcc6HbZCJr+tvVT8X4fW3/5g/WkGvvmwz/88sDtSJzO7r/blvoBDgISDiCjDRZmHpwud7h+6Q9JxFwq1Q==} + '@rollup/rollup-linux-x64-musl@4.53.4': + resolution: {integrity: sha512-lu90KG06NNH19shC5rBPkrh6mrTpq5kviFylPBXQVpdEu0yzb0mDgyxLr6XdcGdBIQTH/UAhDJnL+APZTBu1aQ==} cpu: [x64] os: [linux] - '@rollup/rollup-openharmony-arm64@4.53.3': - resolution: {integrity: sha512-OueLAWgrNSPGAdUdIjSWXw+u/02BRTcnfw9PN41D2vq/JSEPnJnVuBgw18VkN8wcd4fjUs+jFHVM4t9+kBSNLw==} + '@rollup/rollup-openharmony-arm64@4.53.4': + resolution: {integrity: sha512-dFDcmLwsUzhAm/dn0+dMOQZoONVYBtgik0VuY/d5IJUUb787L3Ko/ibvTvddqhb3RaB7vFEozYevHN4ox22R/w==} cpu: [arm64] os: [openharmony] - '@rollup/rollup-win32-arm64-msvc@4.53.3': - resolution: {integrity: sha512-GOFuKpsxR/whszbF/bzydebLiXIHSgsEUp6M0JI8dWvi+fFa1TD6YQa4aSZHtpmh2/uAlj/Dy+nmby3TJ3pkTw==} + '@rollup/rollup-win32-arm64-msvc@4.53.4': + resolution: {integrity: sha512-WvUpUAWmUxZKtRnQWpRKnLW2DEO8HB/l8z6oFFMNuHndMzFTJEXzaYJ5ZAmzNw0L21QQJZsUQFt2oPf3ykAD/w==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.53.3': - resolution: {integrity: sha512-iah+THLcBJdpfZ1TstDFbKNznlzoxa8fmnFYK4V67HvmuNYkVdAywJSoteUszvBQ9/HqN2+9AZghbajMsFT+oA==} + '@rollup/rollup-win32-ia32-msvc@4.53.4': + resolution: {integrity: sha512-JGbeF2/FDU0x2OLySw/jgvkwWUo05BSiJK0dtuI4LyuXbz3wKiC1xHhLB1Tqm5VU6ZZDmAorj45r/IgWNWku5g==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-gnu@4.53.3': - resolution: {integrity: sha512-J9QDiOIZlZLdcot5NXEepDkstocktoVjkaKUtqzgzpt2yWjGlbYiKyp05rWwk4nypbYUNoFAztEgixoLaSETkg==} + '@rollup/rollup-win32-x64-gnu@4.53.4': + resolution: {integrity: sha512-zuuC7AyxLWLubP+mlUwEyR8M1ixW1ERNPHJfXm8x7eQNP4Pzkd7hS3qBuKBR70VRiQ04Kw8FNfRMF5TNxuZq2g==} cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.53.3': - resolution: {integrity: sha512-UhTd8u31dXadv0MopwGgNOBpUVROFKWVQgAg5N1ESyCz8AuBcMqm4AuTjrwgQKGDfoFuz02EuMRHQIw/frmYKQ==} + '@rollup/rollup-win32-x64-msvc@4.53.4': + resolution: {integrity: sha512-Sbx45u/Lbb5RyptSbX7/3deP+/lzEmZ0BTSHxwxN/IMOZDZf8S0AGo0hJD5n/LQssxb5Z3B4og4P2X6Dd8acCA==} cpu: [x64] os: [win32] @@ -2151,8 +2151,8 @@ packages: resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - rollup@4.53.3: - resolution: {integrity: sha512-w8GmOxZfBmKknvdXU1sdM9NHcoQejwF/4mNgj2JuEEdRaHwwF12K7e9eXn1nLZ07ad+du76mkVsyeb2rKGllsA==} + rollup@4.53.4: + resolution: {integrity: sha512-YpXaaArg0MvrnJpvduEDYIp7uGOqKXbH9NsHGQ6SxKCOsNAjZF018MmxefFUulVP2KLtiGw1UvZbr+/ekjvlDg==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -3290,95 +3290,95 @@ snapshots: dependencies: quansync: 0.2.10 - '@rollup/plugin-terser@0.4.4(rollup@4.53.3)': + '@rollup/plugin-terser@0.4.4(rollup@4.53.4)': dependencies: serialize-javascript: 6.0.2 smob: 1.5.0 terser: 5.43.1 optionalDependencies: - rollup: 4.53.3 + rollup: 4.53.4 - '@rollup/plugin-typescript@12.3.0(rollup@4.53.3)(tslib@2.8.1)(typescript@5.8.3)': + '@rollup/plugin-typescript@12.3.0(rollup@4.53.4)(tslib@2.8.1)(typescript@5.8.3)': dependencies: - '@rollup/pluginutils': 5.2.0(rollup@4.53.3) + '@rollup/pluginutils': 5.2.0(rollup@4.53.4) resolve: 1.22.10 typescript: 5.8.3 optionalDependencies: - rollup: 4.53.3 + rollup: 4.53.4 tslib: 2.8.1 - '@rollup/pluginutils@5.2.0(rollup@4.53.3)': + '@rollup/pluginutils@5.2.0(rollup@4.53.4)': dependencies: '@types/estree': 1.0.8 estree-walker: 2.0.2 picomatch: 4.0.3 optionalDependencies: - rollup: 4.53.3 + rollup: 4.53.4 - '@rollup/rollup-android-arm-eabi@4.53.3': + '@rollup/rollup-android-arm-eabi@4.53.4': optional: true - '@rollup/rollup-android-arm64@4.53.3': + '@rollup/rollup-android-arm64@4.53.4': optional: true - '@rollup/rollup-darwin-arm64@4.53.3': + '@rollup/rollup-darwin-arm64@4.53.4': optional: true - '@rollup/rollup-darwin-x64@4.53.3': + '@rollup/rollup-darwin-x64@4.53.4': optional: true - '@rollup/rollup-freebsd-arm64@4.53.3': + '@rollup/rollup-freebsd-arm64@4.53.4': optional: true - '@rollup/rollup-freebsd-x64@4.53.3': + '@rollup/rollup-freebsd-x64@4.53.4': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.53.3': + '@rollup/rollup-linux-arm-gnueabihf@4.53.4': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.53.3': + '@rollup/rollup-linux-arm-musleabihf@4.53.4': optional: true - '@rollup/rollup-linux-arm64-gnu@4.53.3': + '@rollup/rollup-linux-arm64-gnu@4.53.4': optional: true - '@rollup/rollup-linux-arm64-musl@4.53.3': + '@rollup/rollup-linux-arm64-musl@4.53.4': optional: true - '@rollup/rollup-linux-loong64-gnu@4.53.3': + '@rollup/rollup-linux-loong64-gnu@4.53.4': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.53.3': + '@rollup/rollup-linux-ppc64-gnu@4.53.4': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.53.3': + '@rollup/rollup-linux-riscv64-gnu@4.53.4': optional: true - '@rollup/rollup-linux-riscv64-musl@4.53.3': + '@rollup/rollup-linux-riscv64-musl@4.53.4': optional: true - '@rollup/rollup-linux-s390x-gnu@4.53.3': + '@rollup/rollup-linux-s390x-gnu@4.53.4': optional: true - '@rollup/rollup-linux-x64-gnu@4.53.3': + '@rollup/rollup-linux-x64-gnu@4.53.4': optional: true - '@rollup/rollup-linux-x64-musl@4.53.3': + '@rollup/rollup-linux-x64-musl@4.53.4': optional: true - '@rollup/rollup-openharmony-arm64@4.53.3': + '@rollup/rollup-openharmony-arm64@4.53.4': optional: true - '@rollup/rollup-win32-arm64-msvc@4.53.3': + '@rollup/rollup-win32-arm64-msvc@4.53.4': optional: true - '@rollup/rollup-win32-ia32-msvc@4.53.3': + '@rollup/rollup-win32-ia32-msvc@4.53.4': optional: true - '@rollup/rollup-win32-x64-gnu@4.53.3': + '@rollup/rollup-win32-x64-gnu@4.53.4': optional: true - '@rollup/rollup-win32-x64-msvc@4.53.3': + '@rollup/rollup-win32-x64-msvc@4.53.4': optional: true '@standard-schema/spec@1.0.0': {} @@ -4385,32 +4385,32 @@ snapshots: reusify@1.1.0: {} - rollup@4.53.3: + rollup@4.53.4: dependencies: '@types/estree': 1.0.8 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.53.3 - '@rollup/rollup-android-arm64': 4.53.3 - '@rollup/rollup-darwin-arm64': 4.53.3 - '@rollup/rollup-darwin-x64': 4.53.3 - '@rollup/rollup-freebsd-arm64': 4.53.3 - '@rollup/rollup-freebsd-x64': 4.53.3 - '@rollup/rollup-linux-arm-gnueabihf': 4.53.3 - '@rollup/rollup-linux-arm-musleabihf': 4.53.3 - '@rollup/rollup-linux-arm64-gnu': 4.53.3 - '@rollup/rollup-linux-arm64-musl': 4.53.3 - '@rollup/rollup-linux-loong64-gnu': 4.53.3 - '@rollup/rollup-linux-ppc64-gnu': 4.53.3 - '@rollup/rollup-linux-riscv64-gnu': 4.53.3 - '@rollup/rollup-linux-riscv64-musl': 4.53.3 - '@rollup/rollup-linux-s390x-gnu': 4.53.3 - '@rollup/rollup-linux-x64-gnu': 4.53.3 - '@rollup/rollup-linux-x64-musl': 4.53.3 - '@rollup/rollup-openharmony-arm64': 4.53.3 - '@rollup/rollup-win32-arm64-msvc': 4.53.3 - '@rollup/rollup-win32-ia32-msvc': 4.53.3 - '@rollup/rollup-win32-x64-gnu': 4.53.3 - '@rollup/rollup-win32-x64-msvc': 4.53.3 + '@rollup/rollup-android-arm-eabi': 4.53.4 + '@rollup/rollup-android-arm64': 4.53.4 + '@rollup/rollup-darwin-arm64': 4.53.4 + '@rollup/rollup-darwin-x64': 4.53.4 + '@rollup/rollup-freebsd-arm64': 4.53.4 + '@rollup/rollup-freebsd-x64': 4.53.4 + '@rollup/rollup-linux-arm-gnueabihf': 4.53.4 + '@rollup/rollup-linux-arm-musleabihf': 4.53.4 + '@rollup/rollup-linux-arm64-gnu': 4.53.4 + '@rollup/rollup-linux-arm64-musl': 4.53.4 + '@rollup/rollup-linux-loong64-gnu': 4.53.4 + '@rollup/rollup-linux-ppc64-gnu': 4.53.4 + '@rollup/rollup-linux-riscv64-gnu': 4.53.4 + '@rollup/rollup-linux-riscv64-musl': 4.53.4 + '@rollup/rollup-linux-s390x-gnu': 4.53.4 + '@rollup/rollup-linux-x64-gnu': 4.53.4 + '@rollup/rollup-linux-x64-musl': 4.53.4 + '@rollup/rollup-openharmony-arm64': 4.53.4 + '@rollup/rollup-win32-arm64-msvc': 4.53.4 + '@rollup/rollup-win32-ia32-msvc': 4.53.4 + '@rollup/rollup-win32-x64-gnu': 4.53.4 + '@rollup/rollup-win32-x64-msvc': 4.53.4 fsevents: 2.3.3 run-parallel@1.2.0: @@ -4652,7 +4652,7 @@ snapshots: fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 postcss: 8.5.6 - rollup: 4.53.3 + rollup: 4.53.4 tinyglobby: 0.2.15 optionalDependencies: '@types/node': 24.10.0 From e290642fb4ccd2b656517aa771bf21d8dcf5f118 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 19 Dec 2025 17:15:17 +0800 Subject: [PATCH 21/57] chore(deps): update dependency rollup to v4.53.5 (#14676) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- packages/api/package.json | 2 +- pnpm-lock.yaml | 206 +++++++++++++++++++------------------- 2 files changed, 104 insertions(+), 104 deletions(-) diff --git a/packages/api/package.json b/packages/api/package.json index 930142eb2..6b3bffdf0 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -55,7 +55,7 @@ "eslint-plugin-security": "3.0.1", "fast-glob": "3.3.3", "globals": "^16.2.0", - "rollup": "4.53.4", + "rollup": "4.53.5", "tslib": "^2.8.1", "typescript": "^5.8.3", "typescript-eslint": "^8.34.1" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e273bc3dd..381ee880b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -63,10 +63,10 @@ importers: version: 9.29.0 '@rollup/plugin-terser': specifier: 0.4.4 - version: 0.4.4(rollup@4.53.4) + version: 0.4.4(rollup@4.53.5) '@rollup/plugin-typescript': specifier: 12.3.0 - version: 12.3.0(rollup@4.53.4)(tslib@2.8.1)(typescript@5.8.3) + version: 12.3.0(rollup@4.53.5)(tslib@2.8.1)(typescript@5.8.3) '@types/eslint': specifier: ^9.6.1 version: 9.6.1 @@ -89,8 +89,8 @@ importers: specifier: ^16.2.0 version: 16.2.0 rollup: - specifier: 4.53.4 - version: 4.53.4 + specifier: 4.53.5 + version: 4.53.5 tslib: specifier: ^2.8.1 version: 2.8.1 @@ -1125,113 +1125,113 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.53.4': - resolution: {integrity: sha512-PWU3Y92H4DD0bOqorEPp1Y0tbzwAurFmIYpjcObv5axGVOtcTlB0b2UKMd2echo08MgN7jO8WQZSSysvfisFSQ==} + '@rollup/rollup-android-arm-eabi@4.53.5': + resolution: {integrity: sha512-iDGS/h7D8t7tvZ1t6+WPK04KD0MwzLZrG0se1hzBjSi5fyxlsiggoJHwh18PCFNn7tG43OWb6pdZ6Y+rMlmyNQ==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.53.4': - resolution: {integrity: sha512-Gw0/DuVm3rGsqhMGYkSOXXIx20cC3kTlivZeuaGt4gEgILivykNyBWxeUV5Cf2tDA2nPLah26vq3emlRrWVbng==} + '@rollup/rollup-android-arm64@4.53.5': + resolution: {integrity: sha512-wrSAViWvZHBMMlWk6EJhvg8/rjxzyEhEdgfMMjREHEq11EtJ6IP6yfcCH57YAEca2Oe3FNCE9DSTgU70EIGmVw==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.53.4': - resolution: {integrity: sha512-+w06QvXsgzKwdVg5qRLZpTHh1bigHZIqoIUPtiqh05ZiJVUQ6ymOxaPkXTvRPRLH88575ZCRSRM3PwIoNma01Q==} + '@rollup/rollup-darwin-arm64@4.53.5': + resolution: {integrity: sha512-S87zZPBmRO6u1YXQLwpveZm4JfPpAa6oHBX7/ghSiGH3rz/KDgAu1rKdGutV+WUI6tKDMbaBJomhnT30Y2t4VQ==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.53.4': - resolution: {integrity: sha512-EB4Na9G2GsrRNRNFPuxfwvDRDUwQEzJPpiK1vo2zMVhEeufZ1k7J1bKnT0JYDfnPC7RNZ2H5YNQhW6/p2QKATw==} + '@rollup/rollup-darwin-x64@4.53.5': + resolution: {integrity: sha512-YTbnsAaHo6VrAczISxgpTva8EkfQus0VPEVJCEaboHtZRIb6h6j0BNxRBOwnDciFTZLDPW5r+ZBmhL/+YpTZgA==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.53.4': - resolution: {integrity: sha512-bldA8XEqPcs6OYdknoTMaGhjytnwQ0NClSPpWpmufOuGPN5dDmvIa32FygC2gneKK4A1oSx86V1l55hyUWUYFQ==} + '@rollup/rollup-freebsd-arm64@4.53.5': + resolution: {integrity: sha512-1T8eY2J8rKJWzaznV7zedfdhD1BqVs1iqILhmHDq/bqCUZsrMt+j8VCTHhP0vdfbHK3e1IQ7VYx3jlKqwlf+vw==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.53.4': - resolution: {integrity: sha512-3T8GPjH6mixCd0YPn0bXtcuSXi1Lj+15Ujw2CEb7dd24j9thcKscCf88IV7n76WaAdorOzAgSSbuVRg4C8V8Qw==} + '@rollup/rollup-freebsd-x64@4.53.5': + resolution: {integrity: sha512-sHTiuXyBJApxRn+VFMaw1U+Qsz4kcNlxQ742snICYPrY+DDL8/ZbaC4DVIB7vgZmp3jiDaKA0WpBdP0aqPJoBQ==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.53.4': - resolution: {integrity: sha512-UPMMNeC4LXW7ZSHxeP3Edv09aLsFUMaD1TSVW6n1CWMECnUIJMFFB7+XC2lZTdPtvB36tYC0cJWc86mzSsaviw==} + '@rollup/rollup-linux-arm-gnueabihf@4.53.5': + resolution: {integrity: sha512-dV3T9MyAf0w8zPVLVBptVlzaXxka6xg1f16VAQmjg+4KMSTWDvhimI/Y6mp8oHwNrmnmVl9XxJ/w/mO4uIQONA==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.53.4': - resolution: {integrity: sha512-H8uwlV0otHs5Q7WAMSoyvjV9DJPiy5nJ/xnHolY0QptLPjaSsuX7tw+SPIfiYH6cnVx3fe4EWFafo6gH6ekZKA==} + '@rollup/rollup-linux-arm-musleabihf@4.53.5': + resolution: {integrity: sha512-wIGYC1x/hyjP+KAu9+ewDI+fi5XSNiUi9Bvg6KGAh2TsNMA3tSEs+Sh6jJ/r4BV/bx/CyWu2ue9kDnIdRyafcQ==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.53.4': - resolution: {integrity: sha512-BLRwSRwICXz0TXkbIbqJ1ibK+/dSBpTJqDClF61GWIrxTXZWQE78ROeIhgl5MjVs4B4gSLPCFeD4xML9vbzvCQ==} + '@rollup/rollup-linux-arm64-gnu@4.53.5': + resolution: {integrity: sha512-Y+qVA0D9d0y2FRNiG9oM3Hut/DgODZbU9I8pLLPwAsU0tUKZ49cyV1tzmB/qRbSzGvY8lpgGkJuMyuhH7Ma+Vg==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.53.4': - resolution: {integrity: sha512-6bySEjOTbmVcPJAywjpGLckK793A0TJWSbIa0sVwtVGfe/Nz6gOWHOwkshUIAp9j7wg2WKcA4Snu7Y1nUZyQew==} + '@rollup/rollup-linux-arm64-musl@4.53.5': + resolution: {integrity: sha512-juaC4bEgJsyFVfqhtGLz8mbopaWD+WeSOYr5E16y+1of6KQjc0BpwZLuxkClqY1i8sco+MdyoXPNiCkQou09+g==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-loong64-gnu@4.53.4': - resolution: {integrity: sha512-U0ow3bXYJZ5MIbchVusxEycBw7bO6C2u5UvD31i5IMTrnt2p4Fh4ZbHSdc/31TScIJQYHwxbj05BpevB3201ug==} + '@rollup/rollup-linux-loong64-gnu@4.53.5': + resolution: {integrity: sha512-rIEC0hZ17A42iXtHX+EPJVL/CakHo+tT7W0pbzdAGuWOt2jxDFh7A/lRhsNHBcqL4T36+UiAgwO8pbmn3dE8wA==} cpu: [loong64] os: [linux] - '@rollup/rollup-linux-ppc64-gnu@4.53.4': - resolution: {integrity: sha512-iujDk07ZNwGLVn0YIWM80SFN039bHZHCdCCuX9nyx3Jsa2d9V/0Y32F+YadzwbvDxhSeVo9zefkoPnXEImnM5w==} + '@rollup/rollup-linux-ppc64-gnu@4.53.5': + resolution: {integrity: sha512-T7l409NhUE552RcAOcmJHj3xyZ2h7vMWzcwQI0hvn5tqHh3oSoclf9WgTl+0QqffWFG8MEVZZP1/OBglKZx52Q==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.53.4': - resolution: {integrity: sha512-MUtAktiOUSu+AXBpx1fkuG/Bi5rhlorGs3lw5QeJ2X3ziEGAq7vFNdWVde6XGaVqi0LGSvugwjoxSNJfHFTC0g==} + '@rollup/rollup-linux-riscv64-gnu@4.53.5': + resolution: {integrity: sha512-7OK5/GhxbnrMcxIFoYfhV/TkknarkYC1hqUw1wU2xUN3TVRLNT5FmBv4KkheSG2xZ6IEbRAhTooTV2+R5Tk0lQ==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-riscv64-musl@4.53.4': - resolution: {integrity: sha512-btm35eAbDfPtcFEgaXCI5l3c2WXyzwiE8pArhd66SDtoLWmgK5/M7CUxmUglkwtniPzwvWioBKKl6IXLbPf2sQ==} + '@rollup/rollup-linux-riscv64-musl@4.53.5': + resolution: {integrity: sha512-GwuDBE/PsXaTa76lO5eLJTyr2k8QkPipAyOrs4V/KJufHCZBJ495VCGJol35grx9xryk4V+2zd3Ri+3v7NPh+w==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.53.4': - resolution: {integrity: sha512-uJlhKE9ccUTCUlK+HUz/80cVtx2RayadC5ldDrrDUFaJK0SNb8/cCmC9RhBhIWuZ71Nqj4Uoa9+xljKWRogdhA==} + '@rollup/rollup-linux-s390x-gnu@4.53.5': + resolution: {integrity: sha512-IAE1Ziyr1qNfnmiQLHBURAD+eh/zH1pIeJjeShleII7Vj8kyEm2PF77o+lf3WTHDpNJcu4IXJxNO0Zluro8bOw==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.53.4': - resolution: {integrity: sha512-jjEMkzvASQBbzzlzf4os7nzSBd/cvPrpqXCUOqoeCh1dQ4BP3RZCJk8XBeik4MUln3m+8LeTJcY54C/u8wb3DQ==} + '@rollup/rollup-linux-x64-gnu@4.53.5': + resolution: {integrity: sha512-Pg6E+oP7GvZ4XwgRJBuSXZjcqpIW3yCBhK4BcsANvb47qMvAbCjR6E+1a/U2WXz1JJxp9/4Dno3/iSJLcm5auw==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.53.4': - resolution: {integrity: sha512-lu90KG06NNH19shC5rBPkrh6mrTpq5kviFylPBXQVpdEu0yzb0mDgyxLr6XdcGdBIQTH/UAhDJnL+APZTBu1aQ==} + '@rollup/rollup-linux-x64-musl@4.53.5': + resolution: {integrity: sha512-txGtluxDKTxaMDzUduGP0wdfng24y1rygUMnmlUJ88fzCCULCLn7oE5kb2+tRB+MWq1QDZT6ObT5RrR8HFRKqg==} cpu: [x64] os: [linux] - '@rollup/rollup-openharmony-arm64@4.53.4': - resolution: {integrity: sha512-dFDcmLwsUzhAm/dn0+dMOQZoONVYBtgik0VuY/d5IJUUb787L3Ko/ibvTvddqhb3RaB7vFEozYevHN4ox22R/w==} + '@rollup/rollup-openharmony-arm64@4.53.5': + resolution: {integrity: sha512-3DFiLPnTxiOQV993fMc+KO8zXHTcIjgaInrqlG8zDp1TlhYl6WgrOHuJkJQ6M8zHEcntSJsUp1XFZSY8C1DYbg==} cpu: [arm64] os: [openharmony] - '@rollup/rollup-win32-arm64-msvc@4.53.4': - resolution: {integrity: sha512-WvUpUAWmUxZKtRnQWpRKnLW2DEO8HB/l8z6oFFMNuHndMzFTJEXzaYJ5ZAmzNw0L21QQJZsUQFt2oPf3ykAD/w==} + '@rollup/rollup-win32-arm64-msvc@4.53.5': + resolution: {integrity: sha512-nggc/wPpNTgjGg75hu+Q/3i32R00Lq1B6N1DO7MCU340MRKL3WZJMjA9U4K4gzy3dkZPXm9E1Nc81FItBVGRlA==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.53.4': - resolution: {integrity: sha512-JGbeF2/FDU0x2OLySw/jgvkwWUo05BSiJK0dtuI4LyuXbz3wKiC1xHhLB1Tqm5VU6ZZDmAorj45r/IgWNWku5g==} + '@rollup/rollup-win32-ia32-msvc@4.53.5': + resolution: {integrity: sha512-U/54pTbdQpPLBdEzCT6NBCFAfSZMvmjr0twhnD9f4EIvlm9wy3jjQ38yQj1AGznrNO65EWQMgm/QUjuIVrYF9w==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-gnu@4.53.4': - resolution: {integrity: sha512-zuuC7AyxLWLubP+mlUwEyR8M1ixW1ERNPHJfXm8x7eQNP4Pzkd7hS3qBuKBR70VRiQ04Kw8FNfRMF5TNxuZq2g==} + '@rollup/rollup-win32-x64-gnu@4.53.5': + resolution: {integrity: sha512-2NqKgZSuLH9SXBBV2dWNRCZmocgSOx8OJSdpRaEcRlIfX8YrKxUT6z0F1NpvDVhOsl190UFTRh2F2WDWWCYp3A==} cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.53.4': - resolution: {integrity: sha512-Sbx45u/Lbb5RyptSbX7/3deP+/lzEmZ0BTSHxwxN/IMOZDZf8S0AGo0hJD5n/LQssxb5Z3B4og4P2X6Dd8acCA==} + '@rollup/rollup-win32-x64-msvc@4.53.5': + resolution: {integrity: sha512-JRpZUhCfhZ4keB5v0fe02gQJy05GqboPOaxvjugW04RLSYYoB/9t2lx2u/tMs/Na/1NXfY8QYjgRljRpN+MjTQ==} cpu: [x64] os: [win32] @@ -2151,8 +2151,8 @@ packages: resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - rollup@4.53.4: - resolution: {integrity: sha512-YpXaaArg0MvrnJpvduEDYIp7uGOqKXbH9NsHGQ6SxKCOsNAjZF018MmxefFUulVP2KLtiGw1UvZbr+/ekjvlDg==} + rollup@4.53.5: + resolution: {integrity: sha512-iTNAbFSlRpcHeeWu73ywU/8KuU/LZmNCSxp6fjQkJBD3ivUb8tpDrXhIxEzA05HlYMEwmtaUnb3RP+YNv162OQ==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -3290,95 +3290,95 @@ snapshots: dependencies: quansync: 0.2.10 - '@rollup/plugin-terser@0.4.4(rollup@4.53.4)': + '@rollup/plugin-terser@0.4.4(rollup@4.53.5)': dependencies: serialize-javascript: 6.0.2 smob: 1.5.0 terser: 5.43.1 optionalDependencies: - rollup: 4.53.4 + rollup: 4.53.5 - '@rollup/plugin-typescript@12.3.0(rollup@4.53.4)(tslib@2.8.1)(typescript@5.8.3)': + '@rollup/plugin-typescript@12.3.0(rollup@4.53.5)(tslib@2.8.1)(typescript@5.8.3)': dependencies: - '@rollup/pluginutils': 5.2.0(rollup@4.53.4) + '@rollup/pluginutils': 5.2.0(rollup@4.53.5) resolve: 1.22.10 typescript: 5.8.3 optionalDependencies: - rollup: 4.53.4 + rollup: 4.53.5 tslib: 2.8.1 - '@rollup/pluginutils@5.2.0(rollup@4.53.4)': + '@rollup/pluginutils@5.2.0(rollup@4.53.5)': dependencies: '@types/estree': 1.0.8 estree-walker: 2.0.2 picomatch: 4.0.3 optionalDependencies: - rollup: 4.53.4 + rollup: 4.53.5 - '@rollup/rollup-android-arm-eabi@4.53.4': + '@rollup/rollup-android-arm-eabi@4.53.5': optional: true - '@rollup/rollup-android-arm64@4.53.4': + '@rollup/rollup-android-arm64@4.53.5': optional: true - '@rollup/rollup-darwin-arm64@4.53.4': + '@rollup/rollup-darwin-arm64@4.53.5': optional: true - '@rollup/rollup-darwin-x64@4.53.4': + '@rollup/rollup-darwin-x64@4.53.5': optional: true - '@rollup/rollup-freebsd-arm64@4.53.4': + '@rollup/rollup-freebsd-arm64@4.53.5': optional: true - '@rollup/rollup-freebsd-x64@4.53.4': + '@rollup/rollup-freebsd-x64@4.53.5': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.53.4': + '@rollup/rollup-linux-arm-gnueabihf@4.53.5': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.53.4': + '@rollup/rollup-linux-arm-musleabihf@4.53.5': optional: true - '@rollup/rollup-linux-arm64-gnu@4.53.4': + '@rollup/rollup-linux-arm64-gnu@4.53.5': optional: true - '@rollup/rollup-linux-arm64-musl@4.53.4': + '@rollup/rollup-linux-arm64-musl@4.53.5': optional: true - '@rollup/rollup-linux-loong64-gnu@4.53.4': + '@rollup/rollup-linux-loong64-gnu@4.53.5': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.53.4': + '@rollup/rollup-linux-ppc64-gnu@4.53.5': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.53.4': + '@rollup/rollup-linux-riscv64-gnu@4.53.5': optional: true - '@rollup/rollup-linux-riscv64-musl@4.53.4': + '@rollup/rollup-linux-riscv64-musl@4.53.5': optional: true - '@rollup/rollup-linux-s390x-gnu@4.53.4': + '@rollup/rollup-linux-s390x-gnu@4.53.5': optional: true - '@rollup/rollup-linux-x64-gnu@4.53.4': + '@rollup/rollup-linux-x64-gnu@4.53.5': optional: true - '@rollup/rollup-linux-x64-musl@4.53.4': + '@rollup/rollup-linux-x64-musl@4.53.5': optional: true - '@rollup/rollup-openharmony-arm64@4.53.4': + '@rollup/rollup-openharmony-arm64@4.53.5': optional: true - '@rollup/rollup-win32-arm64-msvc@4.53.4': + '@rollup/rollup-win32-arm64-msvc@4.53.5': optional: true - '@rollup/rollup-win32-ia32-msvc@4.53.4': + '@rollup/rollup-win32-ia32-msvc@4.53.5': optional: true - '@rollup/rollup-win32-x64-gnu@4.53.4': + '@rollup/rollup-win32-x64-gnu@4.53.5': optional: true - '@rollup/rollup-win32-x64-msvc@4.53.4': + '@rollup/rollup-win32-x64-msvc@4.53.5': optional: true '@standard-schema/spec@1.0.0': {} @@ -4385,32 +4385,32 @@ snapshots: reusify@1.1.0: {} - rollup@4.53.4: + rollup@4.53.5: dependencies: '@types/estree': 1.0.8 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.53.4 - '@rollup/rollup-android-arm64': 4.53.4 - '@rollup/rollup-darwin-arm64': 4.53.4 - '@rollup/rollup-darwin-x64': 4.53.4 - '@rollup/rollup-freebsd-arm64': 4.53.4 - '@rollup/rollup-freebsd-x64': 4.53.4 - '@rollup/rollup-linux-arm-gnueabihf': 4.53.4 - '@rollup/rollup-linux-arm-musleabihf': 4.53.4 - '@rollup/rollup-linux-arm64-gnu': 4.53.4 - '@rollup/rollup-linux-arm64-musl': 4.53.4 - '@rollup/rollup-linux-loong64-gnu': 4.53.4 - '@rollup/rollup-linux-ppc64-gnu': 4.53.4 - '@rollup/rollup-linux-riscv64-gnu': 4.53.4 - '@rollup/rollup-linux-riscv64-musl': 4.53.4 - '@rollup/rollup-linux-s390x-gnu': 4.53.4 - '@rollup/rollup-linux-x64-gnu': 4.53.4 - '@rollup/rollup-linux-x64-musl': 4.53.4 - '@rollup/rollup-openharmony-arm64': 4.53.4 - '@rollup/rollup-win32-arm64-msvc': 4.53.4 - '@rollup/rollup-win32-ia32-msvc': 4.53.4 - '@rollup/rollup-win32-x64-gnu': 4.53.4 - '@rollup/rollup-win32-x64-msvc': 4.53.4 + '@rollup/rollup-android-arm-eabi': 4.53.5 + '@rollup/rollup-android-arm64': 4.53.5 + '@rollup/rollup-darwin-arm64': 4.53.5 + '@rollup/rollup-darwin-x64': 4.53.5 + '@rollup/rollup-freebsd-arm64': 4.53.5 + '@rollup/rollup-freebsd-x64': 4.53.5 + '@rollup/rollup-linux-arm-gnueabihf': 4.53.5 + '@rollup/rollup-linux-arm-musleabihf': 4.53.5 + '@rollup/rollup-linux-arm64-gnu': 4.53.5 + '@rollup/rollup-linux-arm64-musl': 4.53.5 + '@rollup/rollup-linux-loong64-gnu': 4.53.5 + '@rollup/rollup-linux-ppc64-gnu': 4.53.5 + '@rollup/rollup-linux-riscv64-gnu': 4.53.5 + '@rollup/rollup-linux-riscv64-musl': 4.53.5 + '@rollup/rollup-linux-s390x-gnu': 4.53.5 + '@rollup/rollup-linux-x64-gnu': 4.53.5 + '@rollup/rollup-linux-x64-musl': 4.53.5 + '@rollup/rollup-openharmony-arm64': 4.53.5 + '@rollup/rollup-win32-arm64-msvc': 4.53.5 + '@rollup/rollup-win32-ia32-msvc': 4.53.5 + '@rollup/rollup-win32-x64-gnu': 4.53.5 + '@rollup/rollup-win32-x64-msvc': 4.53.5 fsevents: 2.3.3 run-parallel@1.2.0: @@ -4652,7 +4652,7 @@ snapshots: fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 postcss: 8.5.6 - rollup: 4.53.4 + rollup: 4.53.5 tinyglobby: 0.2.15 optionalDependencies: '@types/node': 24.10.0 From 7f48ee906825a624d73231960f506f2480b05530 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sun, 21 Dec 2025 22:04:33 +0800 Subject: [PATCH 22/57] chore(deps): update rust crate toml_edit to 0.24 (#14683) * chore(deps): update rust crate toml_edit to 0.24 * Downgrade indexmap to 2.11.4 for MSRV --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Tony --- Cargo.lock | 136 ++++++++++++++++++++---------------- crates/tauri-cli/Cargo.toml | 2 +- 2 files changed, 75 insertions(+), 63 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9dae76c32..50bead4b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1083,7 +1083,7 @@ dependencies = [ "serde_json", "textwrap", "thiserror 2.0.12", - "toml 0.9.4", + "toml 0.9.10+spec-1.1.0", "ureq", "which", "windows 0.61.1", @@ -1120,7 +1120,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "374b7c592d9c00c1f4972ea58390ac6b18cbb6ab79011f3bdc90a0b82ca06b77" dependencies = [ "serde", - "toml 0.9.4", + "toml 0.9.10+spec-1.1.0", ] [[package]] @@ -2219,7 +2219,7 @@ dependencies = [ "cc", "memchr", "rustc_version", - "toml 0.9.4", + "toml 0.9.10+spec-1.1.0", "vswhom", "winreg 0.55.0", ] @@ -3105,7 +3105,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.7.0", + "indexmap 2.11.4", "slab", "tokio", "tokio-util", @@ -3124,7 +3124,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.3.1", - "indexmap 2.7.0", + "indexmap 2.11.4", "slab", "tokio", "tokio-util", @@ -3177,9 +3177,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.2" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" [[package]] name = "heck" @@ -3722,13 +3722,14 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.0" +version = "2.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +checksum = "4b0f83760fb341a774ed326568e19f5a863af4a952def8c39f9ab92fd95b88e5" dependencies = [ "equivalent", - "hashbrown 0.15.2", + "hashbrown 0.16.1", "serde", + "serde_core", ] [[package]] @@ -4233,7 +4234,7 @@ checksum = "02cb977175687f33fa4afa0c95c112b987ea1443e5a51c8f8ff27dc618270cc2" dependencies = [ "cssparser", "html5ever", - "indexmap 2.7.0", + "indexmap 2.11.4", "selectors", ] @@ -5263,7 +5264,7 @@ dependencies = [ "crc32fast", "flate2", "hashbrown 0.14.5", - "indexmap 2.7.0", + "indexmap 2.11.4", "memchr", "ruzstd", ] @@ -6093,7 +6094,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016" dependencies = [ "base64 0.22.1", - "indexmap 2.7.0", + "indexmap 2.11.4", "quick-xml", "serde", "time", @@ -7527,10 +7528,11 @@ checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" [[package]] name = "serde" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" dependencies = [ + "serde_core", "serde_derive", ] @@ -7579,10 +7581,19 @@ dependencies = [ ] [[package]] -name = "serde_derive" -version = "1.0.219" +name = "serde_core" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -7611,15 +7622,16 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.140" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" dependencies = [ - "indexmap 2.7.0", + "indexmap 2.11.4", "itoa", "memchr", "ryu", "serde", + "serde_core", ] [[package]] @@ -7654,11 +7666,11 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "1.0.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40734c41988f7306bb04f0ecf60ec0f3f1caa34290e4e8ea471dcd3346483b83" +checksum = "f8bbf91e5a4d6315eee45e704372590b30e260ee83af6639d64557f51b067776" dependencies = [ - "serde", + "serde_core", ] [[package]] @@ -7683,7 +7695,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.7.0", + "indexmap 2.11.4", "serde", "serde_derive", "serde_json", @@ -7709,7 +7721,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.7.0", + "indexmap 2.11.4", "itoa", "ryu", "serde", @@ -8569,7 +8581,7 @@ dependencies = [ "tauri-codegen", "tauri-utils", "tauri-winres", - "toml 0.9.4", + "toml 0.9.10+spec-1.1.0", "walkdir", ] @@ -8691,8 +8703,8 @@ dependencies = [ "tempfile", "thiserror 2.0.12", "tokio", - "toml 0.9.4", - "toml_edit 0.23.2", + "toml 0.9.10+spec-1.1.0", + "toml_edit 0.24.0+spec-1.1.0", "ureq", "url", "uuid", @@ -8822,7 +8834,7 @@ dependencies = [ "serde", "serde_json", "tauri-utils", - "toml 0.9.4", + "toml 0.9.10+spec-1.1.0", "walkdir", ] @@ -8967,7 +8979,7 @@ dependencies = [ "serialize-to-javascript", "swift-rs", "thiserror 2.0.12", - "toml 0.9.4", + "toml 0.9.10+spec-1.1.0", "url", "urlpattern", "uuid", @@ -8981,8 +8993,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c6d9028d41d4de835e3c482c677a8cb88137ac435d6ff9a71f392d4421576c9" dependencies = [ "embed-resource", - "indexmap 2.7.0", - "toml 0.9.4", + "indexmap 2.11.4", + "toml 0.9.10+spec-1.1.0", ] [[package]] @@ -9311,17 +9323,17 @@ dependencies = [ [[package]] name = "toml" -version = "0.9.4" +version = "0.9.10+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ae868b5a0f67631c14589f7e250c1ea2c574ee5ba21c6c8dd4b1485705a5a1" +checksum = "0825052159284a1a8b4d6c0c86cbc801f2da5afd2b225fa548c72f2e74002f48" dependencies = [ - "indexmap 2.7.0", - "serde", - "serde_spanned 1.0.0", - "toml_datetime 0.7.0", + "indexmap 2.11.4", + "serde_core", + "serde_spanned 1.0.4", + "toml_datetime 0.7.5+spec-1.1.0", "toml_parser", "toml_writer", - "winnow 0.7.11", + "winnow 0.7.14", ] [[package]] @@ -9335,11 +9347,11 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.7.0" +version = "0.7.5+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bade1c3e902f58d73d3f294cd7f20391c1cb2fbcb643b73566bc773971df91e3" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" dependencies = [ - "serde", + "serde_core", ] [[package]] @@ -9348,7 +9360,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.7.0", + "indexmap 2.11.4", "toml_datetime 0.6.8", "winnow 0.5.40", ] @@ -9359,7 +9371,7 @@ version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ - "indexmap 2.7.0", + "indexmap 2.11.4", "toml_datetime 0.6.8", "winnow 0.5.40", ] @@ -9370,42 +9382,42 @@ version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ - "indexmap 2.7.0", + "indexmap 2.11.4", "serde", "serde_spanned 0.6.8", "toml_datetime 0.6.8", - "winnow 0.7.11", + "winnow 0.7.14", ] [[package]] name = "toml_edit" -version = "0.23.2" +version = "0.24.0+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1dee9dc43ac2aaf7d3b774e2fba5148212bf2bd9374f4e50152ebe9afd03d42" +checksum = "8c740b185920170a6d9191122cafef7010bd6270a3824594bff6784c04d7f09e" dependencies = [ - "indexmap 2.7.0", - "serde", - "serde_spanned 1.0.0", - "toml_datetime 0.7.0", + "indexmap 2.11.4", + "serde_core", + "serde_spanned 1.0.4", + "toml_datetime 0.7.5+spec-1.1.0", "toml_parser", "toml_writer", - "winnow 0.7.11", + "winnow 0.7.14", ] [[package]] name = "toml_parser" -version = "1.0.1" +version = "1.0.6+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97200572db069e74c512a14117b296ba0a80a30123fbbb5aa1f4a348f639ca30" +checksum = "a3198b4b0a8e11f09dd03e133c0280504d0801269e9afa46362ffde1cbeebf44" dependencies = [ - "winnow 0.7.11", + "winnow 0.7.14", ] [[package]] name = "toml_writer" -version = "1.0.2" +version = "1.0.6+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc842091f2def52017664b53082ecbbeb5c7731092bad69d2c63050401dfd64" +checksum = "ab16f14aed21ee8bfd8ec22513f7287cd4a91aa92e44edfe2c17ddd004e92607" [[package]] name = "tower" @@ -10811,9 +10823,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.7.11" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74c7b26e3480b707944fc872477815d29a8e429d2f93a1ce000f5fa84a15cbcd" +checksum = "5a5364e9d77fcdeeaa6062ced926ee3381faa2ee02d3eb83a5c27a8825540829" dependencies = [ "memchr", ] @@ -11244,7 +11256,7 @@ dependencies = [ "arbitrary", "crc32fast", "flate2", - "indexmap 2.7.0", + "indexmap 2.11.4", "memchr", "zopfli", ] diff --git a/crates/tauri-cli/Cargo.toml b/crates/tauri-cli/Cargo.toml index cbd4bebf6..5aa656ff7 100644 --- a/crates/tauri-cli/Cargo.toml +++ b/crates/tauri-cli/Cargo.toml @@ -56,7 +56,7 @@ notify = "8" notify-debouncer-full = "0.6" shared_child = "1" duct = "1.0" -toml_edit = { version = "0.23", features = ["serde"] } +toml_edit = { version = "0.24", features = ["serde"] } json-patch = "3" tauri-utils = { version = "2.8.1", path = "../tauri-utils", features = [ "isolation", From 51a0d6d66d1a8c8366503dc2378aa8a28a8264e9 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 23 Dec 2025 22:49:57 +0800 Subject: [PATCH 23/57] chore(deps): update dependency rollup to v4.54.0 (#14688) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- packages/api/package.json | 2 +- pnpm-lock.yaml | 206 +++++++++++++++++++------------------- 2 files changed, 104 insertions(+), 104 deletions(-) diff --git a/packages/api/package.json b/packages/api/package.json index 6b3bffdf0..35b0db2b0 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -55,7 +55,7 @@ "eslint-plugin-security": "3.0.1", "fast-glob": "3.3.3", "globals": "^16.2.0", - "rollup": "4.53.5", + "rollup": "4.54.0", "tslib": "^2.8.1", "typescript": "^5.8.3", "typescript-eslint": "^8.34.1" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 381ee880b..55b351c20 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -63,10 +63,10 @@ importers: version: 9.29.0 '@rollup/plugin-terser': specifier: 0.4.4 - version: 0.4.4(rollup@4.53.5) + version: 0.4.4(rollup@4.54.0) '@rollup/plugin-typescript': specifier: 12.3.0 - version: 12.3.0(rollup@4.53.5)(tslib@2.8.1)(typescript@5.8.3) + version: 12.3.0(rollup@4.54.0)(tslib@2.8.1)(typescript@5.8.3) '@types/eslint': specifier: ^9.6.1 version: 9.6.1 @@ -89,8 +89,8 @@ importers: specifier: ^16.2.0 version: 16.2.0 rollup: - specifier: 4.53.5 - version: 4.53.5 + specifier: 4.54.0 + version: 4.54.0 tslib: specifier: ^2.8.1 version: 2.8.1 @@ -1125,113 +1125,113 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.53.5': - resolution: {integrity: sha512-iDGS/h7D8t7tvZ1t6+WPK04KD0MwzLZrG0se1hzBjSi5fyxlsiggoJHwh18PCFNn7tG43OWb6pdZ6Y+rMlmyNQ==} + '@rollup/rollup-android-arm-eabi@4.54.0': + resolution: {integrity: sha512-OywsdRHrFvCdvsewAInDKCNyR3laPA2mc9bRYJ6LBp5IyvF3fvXbbNR0bSzHlZVFtn6E0xw2oZlyjg4rKCVcng==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.53.5': - resolution: {integrity: sha512-wrSAViWvZHBMMlWk6EJhvg8/rjxzyEhEdgfMMjREHEq11EtJ6IP6yfcCH57YAEca2Oe3FNCE9DSTgU70EIGmVw==} + '@rollup/rollup-android-arm64@4.54.0': + resolution: {integrity: sha512-Skx39Uv+u7H224Af+bDgNinitlmHyQX1K/atIA32JP3JQw6hVODX5tkbi2zof/E69M1qH2UoN3Xdxgs90mmNYw==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.53.5': - resolution: {integrity: sha512-S87zZPBmRO6u1YXQLwpveZm4JfPpAa6oHBX7/ghSiGH3rz/KDgAu1rKdGutV+WUI6tKDMbaBJomhnT30Y2t4VQ==} + '@rollup/rollup-darwin-arm64@4.54.0': + resolution: {integrity: sha512-k43D4qta/+6Fq+nCDhhv9yP2HdeKeP56QrUUTW7E6PhZP1US6NDqpJj4MY0jBHlJivVJD5P8NxrjuobZBJTCRw==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.53.5': - resolution: {integrity: sha512-YTbnsAaHo6VrAczISxgpTva8EkfQus0VPEVJCEaboHtZRIb6h6j0BNxRBOwnDciFTZLDPW5r+ZBmhL/+YpTZgA==} + '@rollup/rollup-darwin-x64@4.54.0': + resolution: {integrity: sha512-cOo7biqwkpawslEfox5Vs8/qj83M/aZCSSNIWpVzfU2CYHa2G3P1UN5WF01RdTHSgCkri7XOlTdtk17BezlV3A==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.53.5': - resolution: {integrity: sha512-1T8eY2J8rKJWzaznV7zedfdhD1BqVs1iqILhmHDq/bqCUZsrMt+j8VCTHhP0vdfbHK3e1IQ7VYx3jlKqwlf+vw==} + '@rollup/rollup-freebsd-arm64@4.54.0': + resolution: {integrity: sha512-miSvuFkmvFbgJ1BevMa4CPCFt5MPGw094knM64W9I0giUIMMmRYcGW/JWZDriaw/k1kOBtsWh1z6nIFV1vPNtA==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.53.5': - resolution: {integrity: sha512-sHTiuXyBJApxRn+VFMaw1U+Qsz4kcNlxQ742snICYPrY+DDL8/ZbaC4DVIB7vgZmp3jiDaKA0WpBdP0aqPJoBQ==} + '@rollup/rollup-freebsd-x64@4.54.0': + resolution: {integrity: sha512-KGXIs55+b/ZfZsq9aR026tmr/+7tq6VG6MsnrvF4H8VhwflTIuYh+LFUlIsRdQSgrgmtM3fVATzEAj4hBQlaqQ==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.53.5': - resolution: {integrity: sha512-dV3T9MyAf0w8zPVLVBptVlzaXxka6xg1f16VAQmjg+4KMSTWDvhimI/Y6mp8oHwNrmnmVl9XxJ/w/mO4uIQONA==} + '@rollup/rollup-linux-arm-gnueabihf@4.54.0': + resolution: {integrity: sha512-EHMUcDwhtdRGlXZsGSIuXSYwD5kOT9NVnx9sqzYiwAc91wfYOE1g1djOEDseZJKKqtHAHGwnGPQu3kytmfaXLQ==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.53.5': - resolution: {integrity: sha512-wIGYC1x/hyjP+KAu9+ewDI+fi5XSNiUi9Bvg6KGAh2TsNMA3tSEs+Sh6jJ/r4BV/bx/CyWu2ue9kDnIdRyafcQ==} + '@rollup/rollup-linux-arm-musleabihf@4.54.0': + resolution: {integrity: sha512-+pBrqEjaakN2ySv5RVrj/qLytYhPKEUwk+e3SFU5jTLHIcAtqh2rLrd/OkbNuHJpsBgxsD8ccJt5ga/SeG0JmA==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.53.5': - resolution: {integrity: sha512-Y+qVA0D9d0y2FRNiG9oM3Hut/DgODZbU9I8pLLPwAsU0tUKZ49cyV1tzmB/qRbSzGvY8lpgGkJuMyuhH7Ma+Vg==} + '@rollup/rollup-linux-arm64-gnu@4.54.0': + resolution: {integrity: sha512-NSqc7rE9wuUaRBsBp5ckQ5CVz5aIRKCwsoa6WMF7G01sX3/qHUw/z4pv+D+ahL1EIKy6Enpcnz1RY8pf7bjwng==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.53.5': - resolution: {integrity: sha512-juaC4bEgJsyFVfqhtGLz8mbopaWD+WeSOYr5E16y+1of6KQjc0BpwZLuxkClqY1i8sco+MdyoXPNiCkQou09+g==} + '@rollup/rollup-linux-arm64-musl@4.54.0': + resolution: {integrity: sha512-gr5vDbg3Bakga5kbdpqx81m2n9IX8M6gIMlQQIXiLTNeQW6CucvuInJ91EuCJ/JYvc+rcLLsDFcfAD1K7fMofg==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-loong64-gnu@4.53.5': - resolution: {integrity: sha512-rIEC0hZ17A42iXtHX+EPJVL/CakHo+tT7W0pbzdAGuWOt2jxDFh7A/lRhsNHBcqL4T36+UiAgwO8pbmn3dE8wA==} + '@rollup/rollup-linux-loong64-gnu@4.54.0': + resolution: {integrity: sha512-gsrtB1NA3ZYj2vq0Rzkylo9ylCtW/PhpLEivlgWe0bpgtX5+9j9EZa0wtZiCjgu6zmSeZWyI/e2YRX1URozpIw==} cpu: [loong64] os: [linux] - '@rollup/rollup-linux-ppc64-gnu@4.53.5': - resolution: {integrity: sha512-T7l409NhUE552RcAOcmJHj3xyZ2h7vMWzcwQI0hvn5tqHh3oSoclf9WgTl+0QqffWFG8MEVZZP1/OBglKZx52Q==} + '@rollup/rollup-linux-ppc64-gnu@4.54.0': + resolution: {integrity: sha512-y3qNOfTBStmFNq+t4s7Tmc9hW2ENtPg8FeUD/VShI7rKxNW7O4fFeaYbMsd3tpFlIg1Q8IapFgy7Q9i2BqeBvA==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.53.5': - resolution: {integrity: sha512-7OK5/GhxbnrMcxIFoYfhV/TkknarkYC1hqUw1wU2xUN3TVRLNT5FmBv4KkheSG2xZ6IEbRAhTooTV2+R5Tk0lQ==} + '@rollup/rollup-linux-riscv64-gnu@4.54.0': + resolution: {integrity: sha512-89sepv7h2lIVPsFma8iwmccN7Yjjtgz0Rj/Ou6fEqg3HDhpCa+Et+YSufy27i6b0Wav69Qv4WBNl3Rs6pwhebQ==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-riscv64-musl@4.53.5': - resolution: {integrity: sha512-GwuDBE/PsXaTa76lO5eLJTyr2k8QkPipAyOrs4V/KJufHCZBJ495VCGJol35grx9xryk4V+2zd3Ri+3v7NPh+w==} + '@rollup/rollup-linux-riscv64-musl@4.54.0': + resolution: {integrity: sha512-ZcU77ieh0M2Q8Ur7D5X7KvK+UxbXeDHwiOt/CPSBTI1fBmeDMivW0dPkdqkT4rOgDjrDDBUed9x4EgraIKoR2A==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.53.5': - resolution: {integrity: sha512-IAE1Ziyr1qNfnmiQLHBURAD+eh/zH1pIeJjeShleII7Vj8kyEm2PF77o+lf3WTHDpNJcu4IXJxNO0Zluro8bOw==} + '@rollup/rollup-linux-s390x-gnu@4.54.0': + resolution: {integrity: sha512-2AdWy5RdDF5+4YfG/YesGDDtbyJlC9LHmL6rZw6FurBJ5n4vFGupsOBGfwMRjBYH7qRQowT8D/U4LoSvVwOhSQ==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.53.5': - resolution: {integrity: sha512-Pg6E+oP7GvZ4XwgRJBuSXZjcqpIW3yCBhK4BcsANvb47qMvAbCjR6E+1a/U2WXz1JJxp9/4Dno3/iSJLcm5auw==} + '@rollup/rollup-linux-x64-gnu@4.54.0': + resolution: {integrity: sha512-WGt5J8Ij/rvyqpFexxk3ffKqqbLf9AqrTBbWDk7ApGUzaIs6V+s2s84kAxklFwmMF/vBNGrVdYgbblCOFFezMQ==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.53.5': - resolution: {integrity: sha512-txGtluxDKTxaMDzUduGP0wdfng24y1rygUMnmlUJ88fzCCULCLn7oE5kb2+tRB+MWq1QDZT6ObT5RrR8HFRKqg==} + '@rollup/rollup-linux-x64-musl@4.54.0': + resolution: {integrity: sha512-JzQmb38ATzHjxlPHuTH6tE7ojnMKM2kYNzt44LO/jJi8BpceEC8QuXYA908n8r3CNuG/B3BV8VR3Hi1rYtmPiw==} cpu: [x64] os: [linux] - '@rollup/rollup-openharmony-arm64@4.53.5': - resolution: {integrity: sha512-3DFiLPnTxiOQV993fMc+KO8zXHTcIjgaInrqlG8zDp1TlhYl6WgrOHuJkJQ6M8zHEcntSJsUp1XFZSY8C1DYbg==} + '@rollup/rollup-openharmony-arm64@4.54.0': + resolution: {integrity: sha512-huT3fd0iC7jigGh7n3q/+lfPcXxBi+om/Rs3yiFxjvSxbSB6aohDFXbWvlspaqjeOh+hx7DDHS+5Es5qRkWkZg==} cpu: [arm64] os: [openharmony] - '@rollup/rollup-win32-arm64-msvc@4.53.5': - resolution: {integrity: sha512-nggc/wPpNTgjGg75hu+Q/3i32R00Lq1B6N1DO7MCU340MRKL3WZJMjA9U4K4gzy3dkZPXm9E1Nc81FItBVGRlA==} + '@rollup/rollup-win32-arm64-msvc@4.54.0': + resolution: {integrity: sha512-c2V0W1bsKIKfbLMBu/WGBz6Yci8nJ/ZJdheE0EwB73N3MvHYKiKGs3mVilX4Gs70eGeDaMqEob25Tw2Gb9Nqyw==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.53.5': - resolution: {integrity: sha512-U/54pTbdQpPLBdEzCT6NBCFAfSZMvmjr0twhnD9f4EIvlm9wy3jjQ38yQj1AGznrNO65EWQMgm/QUjuIVrYF9w==} + '@rollup/rollup-win32-ia32-msvc@4.54.0': + resolution: {integrity: sha512-woEHgqQqDCkAzrDhvDipnSirm5vxUXtSKDYTVpZG3nUdW/VVB5VdCYA2iReSj/u3yCZzXID4kuKG7OynPnB3WQ==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-gnu@4.53.5': - resolution: {integrity: sha512-2NqKgZSuLH9SXBBV2dWNRCZmocgSOx8OJSdpRaEcRlIfX8YrKxUT6z0F1NpvDVhOsl190UFTRh2F2WDWWCYp3A==} + '@rollup/rollup-win32-x64-gnu@4.54.0': + resolution: {integrity: sha512-dzAc53LOuFvHwbCEOS0rPbXp6SIhAf2txMP5p6mGyOXXw5mWY8NGGbPMPrs4P1WItkfApDathBj/NzMLUZ9rtQ==} cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.53.5': - resolution: {integrity: sha512-JRpZUhCfhZ4keB5v0fe02gQJy05GqboPOaxvjugW04RLSYYoB/9t2lx2u/tMs/Na/1NXfY8QYjgRljRpN+MjTQ==} + '@rollup/rollup-win32-x64-msvc@4.54.0': + resolution: {integrity: sha512-hYT5d3YNdSh3mbCU1gwQyPgQd3T2ne0A3KG8KSBdav5TiBg6eInVmV+TeR5uHufiIgSFg0XsOWGW5/RhNcSvPg==} cpu: [x64] os: [win32] @@ -2151,8 +2151,8 @@ packages: resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - rollup@4.53.5: - resolution: {integrity: sha512-iTNAbFSlRpcHeeWu73ywU/8KuU/LZmNCSxp6fjQkJBD3ivUb8tpDrXhIxEzA05HlYMEwmtaUnb3RP+YNv162OQ==} + rollup@4.54.0: + resolution: {integrity: sha512-3nk8Y3a9Ea8szgKhinMlGMhGMw89mqule3KWczxhIzqudyHdCIOHw8WJlj/r329fACjKLEh13ZSk7oE22kyeIw==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -3290,95 +3290,95 @@ snapshots: dependencies: quansync: 0.2.10 - '@rollup/plugin-terser@0.4.4(rollup@4.53.5)': + '@rollup/plugin-terser@0.4.4(rollup@4.54.0)': dependencies: serialize-javascript: 6.0.2 smob: 1.5.0 terser: 5.43.1 optionalDependencies: - rollup: 4.53.5 + rollup: 4.54.0 - '@rollup/plugin-typescript@12.3.0(rollup@4.53.5)(tslib@2.8.1)(typescript@5.8.3)': + '@rollup/plugin-typescript@12.3.0(rollup@4.54.0)(tslib@2.8.1)(typescript@5.8.3)': dependencies: - '@rollup/pluginutils': 5.2.0(rollup@4.53.5) + '@rollup/pluginutils': 5.2.0(rollup@4.54.0) resolve: 1.22.10 typescript: 5.8.3 optionalDependencies: - rollup: 4.53.5 + rollup: 4.54.0 tslib: 2.8.1 - '@rollup/pluginutils@5.2.0(rollup@4.53.5)': + '@rollup/pluginutils@5.2.0(rollup@4.54.0)': dependencies: '@types/estree': 1.0.8 estree-walker: 2.0.2 picomatch: 4.0.3 optionalDependencies: - rollup: 4.53.5 + rollup: 4.54.0 - '@rollup/rollup-android-arm-eabi@4.53.5': + '@rollup/rollup-android-arm-eabi@4.54.0': optional: true - '@rollup/rollup-android-arm64@4.53.5': + '@rollup/rollup-android-arm64@4.54.0': optional: true - '@rollup/rollup-darwin-arm64@4.53.5': + '@rollup/rollup-darwin-arm64@4.54.0': optional: true - '@rollup/rollup-darwin-x64@4.53.5': + '@rollup/rollup-darwin-x64@4.54.0': optional: true - '@rollup/rollup-freebsd-arm64@4.53.5': + '@rollup/rollup-freebsd-arm64@4.54.0': optional: true - '@rollup/rollup-freebsd-x64@4.53.5': + '@rollup/rollup-freebsd-x64@4.54.0': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.53.5': + '@rollup/rollup-linux-arm-gnueabihf@4.54.0': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.53.5': + '@rollup/rollup-linux-arm-musleabihf@4.54.0': optional: true - '@rollup/rollup-linux-arm64-gnu@4.53.5': + '@rollup/rollup-linux-arm64-gnu@4.54.0': optional: true - '@rollup/rollup-linux-arm64-musl@4.53.5': + '@rollup/rollup-linux-arm64-musl@4.54.0': optional: true - '@rollup/rollup-linux-loong64-gnu@4.53.5': + '@rollup/rollup-linux-loong64-gnu@4.54.0': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.53.5': + '@rollup/rollup-linux-ppc64-gnu@4.54.0': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.53.5': + '@rollup/rollup-linux-riscv64-gnu@4.54.0': optional: true - '@rollup/rollup-linux-riscv64-musl@4.53.5': + '@rollup/rollup-linux-riscv64-musl@4.54.0': optional: true - '@rollup/rollup-linux-s390x-gnu@4.53.5': + '@rollup/rollup-linux-s390x-gnu@4.54.0': optional: true - '@rollup/rollup-linux-x64-gnu@4.53.5': + '@rollup/rollup-linux-x64-gnu@4.54.0': optional: true - '@rollup/rollup-linux-x64-musl@4.53.5': + '@rollup/rollup-linux-x64-musl@4.54.0': optional: true - '@rollup/rollup-openharmony-arm64@4.53.5': + '@rollup/rollup-openharmony-arm64@4.54.0': optional: true - '@rollup/rollup-win32-arm64-msvc@4.53.5': + '@rollup/rollup-win32-arm64-msvc@4.54.0': optional: true - '@rollup/rollup-win32-ia32-msvc@4.53.5': + '@rollup/rollup-win32-ia32-msvc@4.54.0': optional: true - '@rollup/rollup-win32-x64-gnu@4.53.5': + '@rollup/rollup-win32-x64-gnu@4.54.0': optional: true - '@rollup/rollup-win32-x64-msvc@4.53.5': + '@rollup/rollup-win32-x64-msvc@4.54.0': optional: true '@standard-schema/spec@1.0.0': {} @@ -4385,32 +4385,32 @@ snapshots: reusify@1.1.0: {} - rollup@4.53.5: + rollup@4.54.0: dependencies: '@types/estree': 1.0.8 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.53.5 - '@rollup/rollup-android-arm64': 4.53.5 - '@rollup/rollup-darwin-arm64': 4.53.5 - '@rollup/rollup-darwin-x64': 4.53.5 - '@rollup/rollup-freebsd-arm64': 4.53.5 - '@rollup/rollup-freebsd-x64': 4.53.5 - '@rollup/rollup-linux-arm-gnueabihf': 4.53.5 - '@rollup/rollup-linux-arm-musleabihf': 4.53.5 - '@rollup/rollup-linux-arm64-gnu': 4.53.5 - '@rollup/rollup-linux-arm64-musl': 4.53.5 - '@rollup/rollup-linux-loong64-gnu': 4.53.5 - '@rollup/rollup-linux-ppc64-gnu': 4.53.5 - '@rollup/rollup-linux-riscv64-gnu': 4.53.5 - '@rollup/rollup-linux-riscv64-musl': 4.53.5 - '@rollup/rollup-linux-s390x-gnu': 4.53.5 - '@rollup/rollup-linux-x64-gnu': 4.53.5 - '@rollup/rollup-linux-x64-musl': 4.53.5 - '@rollup/rollup-openharmony-arm64': 4.53.5 - '@rollup/rollup-win32-arm64-msvc': 4.53.5 - '@rollup/rollup-win32-ia32-msvc': 4.53.5 - '@rollup/rollup-win32-x64-gnu': 4.53.5 - '@rollup/rollup-win32-x64-msvc': 4.53.5 + '@rollup/rollup-android-arm-eabi': 4.54.0 + '@rollup/rollup-android-arm64': 4.54.0 + '@rollup/rollup-darwin-arm64': 4.54.0 + '@rollup/rollup-darwin-x64': 4.54.0 + '@rollup/rollup-freebsd-arm64': 4.54.0 + '@rollup/rollup-freebsd-x64': 4.54.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.54.0 + '@rollup/rollup-linux-arm-musleabihf': 4.54.0 + '@rollup/rollup-linux-arm64-gnu': 4.54.0 + '@rollup/rollup-linux-arm64-musl': 4.54.0 + '@rollup/rollup-linux-loong64-gnu': 4.54.0 + '@rollup/rollup-linux-ppc64-gnu': 4.54.0 + '@rollup/rollup-linux-riscv64-gnu': 4.54.0 + '@rollup/rollup-linux-riscv64-musl': 4.54.0 + '@rollup/rollup-linux-s390x-gnu': 4.54.0 + '@rollup/rollup-linux-x64-gnu': 4.54.0 + '@rollup/rollup-linux-x64-musl': 4.54.0 + '@rollup/rollup-openharmony-arm64': 4.54.0 + '@rollup/rollup-win32-arm64-msvc': 4.54.0 + '@rollup/rollup-win32-ia32-msvc': 4.54.0 + '@rollup/rollup-win32-x64-gnu': 4.54.0 + '@rollup/rollup-win32-x64-msvc': 4.54.0 fsevents: 2.3.3 run-parallel@1.2.0: @@ -4652,7 +4652,7 @@ snapshots: fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 postcss: 8.5.6 - rollup: 4.53.5 + rollup: 4.54.0 tinyglobby: 0.2.15 optionalDependencies: '@types/node': 24.10.0 From c1d82eb3a3fa4b555745ba699edf1cc532030117 Mon Sep 17 00:00:00 2001 From: Kushal Meghani <168952248+KushalMeghani1644@users.noreply.github.com> Date: Thu, 25 Dec 2025 17:33:15 +0530 Subject: [PATCH 24/57] fix(linux): reuse WebContext to prevent WebKitNetworkProcess leak (#14628) Co-authored-by: Fabian-Lars --- .changes/linux-webcontext.md | 5 +++++ crates/tauri-runtime-wry/src/lib.rs | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 .changes/linux-webcontext.md diff --git a/.changes/linux-webcontext.md b/.changes/linux-webcontext.md new file mode 100644 index 000000000..0a14638d3 --- /dev/null +++ b/.changes/linux-webcontext.md @@ -0,0 +1,5 @@ +--- +tauri-runtime-wry: patch:bug +--- + +On Linux, keep the WebContext alive to prevent zombie WebKit processes after repeatedly closing all windows and re-opening them. diff --git a/crates/tauri-runtime-wry/src/lib.rs b/crates/tauri-runtime-wry/src/lib.rs index 6b919e746..821fbacec 100644 --- a/crates/tauri-runtime-wry/src/lib.rs +++ b/crates/tauri-runtime-wry/src/lib.rs @@ -2422,6 +2422,18 @@ impl Drop for WebviewWrapper { if let Some(web_context) = context_store.get_mut(&self.context_key) { web_context.referenced_by_webviews.remove(&self.label); + // https://github.com/tauri-apps/tauri/issues/14626 + // Because WebKit does not close its network process even when no webviews are running, + // we need to ensure to re-use the existing process on Linux by keeping the WebContext + // alive for the lifetime of the app. + // WebKit on macOS handles this itself. + #[cfg(not(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + )))] if web_context.referenced_by_webviews.is_empty() { context_store.remove(&self.context_key); } From 0650852d147ae4ac427411c9f4cd5d7f4596b010 Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Thu, 25 Dec 2025 20:05:02 +0800 Subject: [PATCH 25/57] docs: things related to `WebviewUrl` (#14692) * Typos * Rename to `handler`/`protocol_handler` * Fix the `AssetResolver::get` fallback docs * Refactor and update the docs for `get_url` * Rename the remaining ones to `get_app_url` * Apply suggestions from code review Co-authored-by: Fabian-Lars * Generate schema --- crates/tauri-cli/config.schema.json | 8 +-- crates/tauri-runtime/src/webview.rs | 9 ++-- .../schemas/config.schema.json | 8 +-- crates/tauri-utils/src/config.rs | 8 +-- crates/tauri/src/app.rs | 28 +++++----- crates/tauri/src/manager/mod.rs | 54 +++++++++---------- crates/tauri/src/manager/webview.rs | 8 +-- crates/tauri/src/plugin.rs | 10 ++-- crates/tauri/src/protocol/mod.rs | 2 + crates/tauri/src/protocol/tauri.rs | 6 +-- crates/tauri/src/webview/mod.rs | 6 +-- 11 files changed, 73 insertions(+), 74 deletions(-) diff --git a/crates/tauri-cli/config.schema.json b/crates/tauri-cli/config.schema.json index 148379e83..5e4a5a349 100644 --- a/crates/tauri-cli/config.schema.json +++ b/crates/tauri-cli/config.schema.json @@ -1991,7 +1991,7 @@ "description": "Defines the URL or assets to embed in the application.", "anyOf": [ { - "description": "An external URL that should be used as the default application URL.", + "description": "An external URL that should be used as the default application URL. No assets are embedded in the app in this case.", "type": "string", "format": "uri" }, @@ -2000,7 +2000,7 @@ "type": "string" }, { - "description": "An array of files to embed on the app.", + "description": "An array of files to embed in the app.", "type": "array", "items": { "type": "string" @@ -2792,7 +2792,7 @@ "type": "object", "properties": { "version": { - "description": "MSI installer version in the format `major.minor.patch.build` (build is optional).\n\n Because a valid version is required for MSI installer, it will be derived from [`Config::version`] if this field is not set.\n\n The first field is the major version and has a maximum value of 255. The second field is the minor version and has a maximum value of 255.\n The third and foruth fields have a maximum value of 65,535.\n\n See for more info.", + "description": "MSI installer version in the format `major.minor.patch.build` (build is optional).\n\n Because a valid version is required for MSI installer, it will be derived from [`Config::version`] if this field is not set.\n\n The first field is the major version and has a maximum value of 255. The second field is the minor version and has a maximum value of 255.\n The third and fourth fields have a maximum value of 65,535.\n\n See for more info.", "type": [ "string", "null" @@ -3096,7 +3096,7 @@ "description": "Custom Signing Command configuration.", "anyOf": [ { - "description": "A string notation of the script to execute.\n\n \"%1\" will be replaced with the path to the binary to be signed.\n\n This is a simpler notation for the command.\n Tauri will split the string with `' '` and use the first element as the command name and the rest as arguments.\n\n If you need to use whitespace in the command or arguments, use the object notation [`Self::ScriptWithOptions`].", + "description": "A string notation of the script to execute.\n\n \"%1\" will be replaced with the path to the binary to be signed.\n\n This is a simpler notation for the command.\n Tauri will split the string with `' '` and use the first element as the command name and the rest as arguments.\n\n If you need to use whitespace in the command or arguments, use the object notation [`Self::CommandWithOptions`].", "type": "string" }, { diff --git a/crates/tauri-runtime/src/webview.rs b/crates/tauri-runtime/src/webview.rs index f9c904ef9..efce7d814 100644 --- a/crates/tauri-runtime/src/webview.rs +++ b/crates/tauri-runtime/src/webview.rs @@ -23,7 +23,7 @@ use std::{ sync::Arc, }; -type UriSchemeProtocol = dyn Fn(&str, http::Request>, Box>) + Send>) +type UriSchemeProtocolHandler = dyn Fn(&str, http::Request>, Box>) + Send>) + Send + Sync + 'static; @@ -199,7 +199,8 @@ pub struct PendingWebview> { /// The [`WebviewAttributes`] that the webview will be created with. pub webview_attributes: WebviewAttributes, - pub uri_scheme_protocols: HashMap>, + /// Custom protocols to register on the webview + pub uri_scheme_protocols: HashMap>, /// How to handle IPC calls on the webview. pub ipc_handler: Option>, @@ -263,12 +264,12 @@ impl> PendingWebview { >( &mut self, uri_scheme: N, - protocol: H, + protocol_handler: H, ) { let uri_scheme = uri_scheme.into(); self .uri_scheme_protocols - .insert(uri_scheme, Box::new(protocol)); + .insert(uri_scheme, Box::new(protocol_handler)); } #[cfg(target_os = "android")] diff --git a/crates/tauri-schema-generator/schemas/config.schema.json b/crates/tauri-schema-generator/schemas/config.schema.json index 148379e83..5e4a5a349 100644 --- a/crates/tauri-schema-generator/schemas/config.schema.json +++ b/crates/tauri-schema-generator/schemas/config.schema.json @@ -1991,7 +1991,7 @@ "description": "Defines the URL or assets to embed in the application.", "anyOf": [ { - "description": "An external URL that should be used as the default application URL.", + "description": "An external URL that should be used as the default application URL. No assets are embedded in the app in this case.", "type": "string", "format": "uri" }, @@ -2000,7 +2000,7 @@ "type": "string" }, { - "description": "An array of files to embed on the app.", + "description": "An array of files to embed in the app.", "type": "array", "items": { "type": "string" @@ -2792,7 +2792,7 @@ "type": "object", "properties": { "version": { - "description": "MSI installer version in the format `major.minor.patch.build` (build is optional).\n\n Because a valid version is required for MSI installer, it will be derived from [`Config::version`] if this field is not set.\n\n The first field is the major version and has a maximum value of 255. The second field is the minor version and has a maximum value of 255.\n The third and foruth fields have a maximum value of 65,535.\n\n See for more info.", + "description": "MSI installer version in the format `major.minor.patch.build` (build is optional).\n\n Because a valid version is required for MSI installer, it will be derived from [`Config::version`] if this field is not set.\n\n The first field is the major version and has a maximum value of 255. The second field is the minor version and has a maximum value of 255.\n The third and fourth fields have a maximum value of 65,535.\n\n See for more info.", "type": [ "string", "null" @@ -3096,7 +3096,7 @@ "description": "Custom Signing Command configuration.", "anyOf": [ { - "description": "A string notation of the script to execute.\n\n \"%1\" will be replaced with the path to the binary to be signed.\n\n This is a simpler notation for the command.\n Tauri will split the string with `' '` and use the first element as the command name and the rest as arguments.\n\n If you need to use whitespace in the command or arguments, use the object notation [`Self::ScriptWithOptions`].", + "description": "A string notation of the script to execute.\n\n \"%1\" will be replaced with the path to the binary to be signed.\n\n This is a simpler notation for the command.\n Tauri will split the string with `' '` and use the first element as the command name and the rest as arguments.\n\n If you need to use whitespace in the command or arguments, use the object notation [`Self::CommandWithOptions`].", "type": "string" }, { diff --git a/crates/tauri-utils/src/config.rs b/crates/tauri-utils/src/config.rs index 24b111830..2c1b6938e 100644 --- a/crates/tauri-utils/src/config.rs +++ b/crates/tauri-utils/src/config.rs @@ -739,7 +739,7 @@ pub struct WixConfig { /// Because a valid version is required for MSI installer, it will be derived from [`Config::version`] if this field is not set. /// /// The first field is the major version and has a maximum value of 255. The second field is the minor version and has a maximum value of 255. - /// The third and foruth fields have a maximum value of 65,535. + /// The third and fourth fields have a maximum value of 65,535. /// /// See for more info. pub version: Option, @@ -996,7 +996,7 @@ pub enum CustomSignCommandConfig { /// This is a simpler notation for the command. /// Tauri will split the string with `' '` and use the first element as the command name and the rest as arguments. /// - /// If you need to use whitespace in the command or arguments, use the object notation [`Self::ScriptWithOptions`]. + /// If you need to use whitespace in the command or arguments, use the object notation [`Self::CommandWithOptions`]. Command(String), /// An object notation of the command. /// @@ -2941,11 +2941,11 @@ fn default_min_sdk_version() -> u32 { #[serde(untagged, deny_unknown_fields)] #[non_exhaustive] pub enum FrontendDist { - /// An external URL that should be used as the default application URL. + /// An external URL that should be used as the default application URL. No assets are embedded in the app in this case. Url(Url), /// Path to a directory containing the frontend dist assets. Directory(PathBuf), - /// An array of files to embed on the app. + /// An array of files to embed in the app. Files(Vec), } diff --git a/crates/tauri/src/app.rs b/crates/tauri/src/app.rs index b950895bc..e53f22675 100644 --- a/crates/tauri/src/app.rs +++ b/crates/tauri/src/app.rs @@ -278,12 +278,11 @@ impl AssetResolver { /// were configured with [`crate::webview::WebviewBuilder::use_https_scheme`] or `tauri.conf.json > app > windows > useHttpsScheme`. /// If you are resolving an asset for a webview with a more dynamic configuration, see [`AssetResolver::get_for_scheme`]. /// - /// Resolves to the embedded asset that is part of the app - /// in dev when [`devUrl`](https://v2.tauri.app/reference/config/#devurl) points to a folder in your filesystem - /// or in production when [`frontendDist`](https://v2.tauri.app/reference/config/#frontenddist) - /// points to your frontend assets. + /// In production, this resolves to the embedded asset bundled in the app executable + /// which contains your frontend assets in [`frontendDist`](https://v2.tauri.app/reference/config/#frontenddist) during build time. /// - /// Fallbacks to reading the asset from the [distDir] folder so the behavior is consistent in development. + /// In dev mode, if [`devUrl`](https://v2.tauri.app/reference/config/#devurl) is set, we don't bundle the assets to reduce re-builds, + /// and this will fall back to read from `frontendDist` directly. /// Note that the dist directory must exist so you might need to build your frontend assets first. pub fn get(&self, path: String) -> Option { let use_https_scheme = self @@ -301,9 +300,8 @@ impl AssetResolver { pub fn get_for_scheme(&self, path: String, use_https_scheme: bool) -> Option { #[cfg(dev)] { - // on dev if the devPath is a path to a directory we have the embedded assets - // so we can use get_asset() directly - // we only fallback to reading from distDir directly if we're using an external URL (which is likely) + // We don't bundle the assets when in dev mode and `devUrl` is set, so fall back to read from `frontendDist` directly + // TODO: Maybe handle `FrontendDist::Files` as well if let (Some(_), Some(crate::utils::config::FrontendDist::Directory(dist_path))) = ( &self.manager.config().build.dev_url, &self.manager.config().build.frontend_dist, @@ -1990,13 +1988,13 @@ tauri::Builder::default() >( mut self, uri_scheme: N, - protocol: H, + protocol_handler: H, ) -> Self { self.uri_scheme_protocols.insert( uri_scheme.into(), Arc::new(UriSchemeProtocol { - protocol: Box::new(move |ctx, request, responder| { - responder.respond(protocol(ctx, request)) + handler: Box::new(move |ctx, request, responder| { + responder.respond(protocol_handler(ctx, request)) }), }), ); @@ -2032,8 +2030,8 @@ tauri::Builder::default() /// .body("failed to read file".as_bytes().to_vec()) /// .unwrap() /// ); - /// } - /// }); + /// } + /// }); /// }); /// ``` /// @@ -2054,12 +2052,12 @@ tauri::Builder::default() >( mut self, uri_scheme: N, - protocol: H, + protocol_handler: H, ) -> Self { self.uri_scheme_protocols.insert( uri_scheme.into(), Arc::new(UriSchemeProtocol { - protocol: Box::new(protocol), + handler: Box::new(protocol_handler), }), ); self diff --git a/crates/tauri/src/manager/mod.rs b/crates/tauri/src/manager/mod.rs index 2126dd895..9973ef46d 100644 --- a/crates/tauri/src/manager/mod.rs +++ b/crates/tauri/src/manager/mod.rs @@ -333,25 +333,9 @@ impl AppManager { self.state.clone() } - /// Get the base path to serve data from. - /// - /// * In dev mode, this will be based on the `devUrl` configuration value. - /// * Otherwise, this will be based on the `frontendDist` configuration value. - #[cfg(not(dev))] - fn base_path(&self) -> Option<&Url> { - use crate::utils::config::FrontendDist; - match self.config.build.frontend_dist.as_ref() { - Some(FrontendDist::Url(url)) => Some(url), - _ => None, - } - } - - #[cfg(dev)] - fn base_path(&self) -> Option<&Url> { - self.config.build.dev_url.as_ref() - } - - pub(crate) fn protocol_url(&self, https: bool) -> Cow<'_, Url> { + /// The `tauri` custom protocol URL we use to serve the embedded assets. + /// Returns `tauri://localhost` or its `wry` workaround URL `http://tauri.localhost`/`https://tauri.localhost` + pub(crate) fn tauri_protocol_url(&self, https: bool) -> Cow<'_, Url> { if cfg!(windows) || cfg!(target_os = "android") { let scheme = if https { "https" } else { "http" }; Cow::Owned(Url::parse(&format!("{scheme}://tauri.localhost")).unwrap()) @@ -360,13 +344,24 @@ impl AppManager { } } - /// Get the base URL to use for webview requests. + /// Get the base app URL for [`WebviewUrl::App`](tauri_utils::config::WebviewUrl::App). /// - /// In dev mode, this will be based on the `devUrl` configuration value. - pub(crate) fn get_url(&self, https: bool) -> Cow<'_, Url> { - match self.base_path() { - Some(url) => Cow::Borrowed(url), - _ => self.protocol_url(https), + /// * In dev mode, this is the [`devUrl`](tauri_utils::config::BuildConfig::dev_url) configuration value if it exsits. + /// * In production mode, this is the [`frontendDist`](tauri_utils::config::BuildConfig::frontend_dist) configuration value if it's a [`FrontendDist::Url`](tauri_utils::config::FrontendDist::Url). + /// * Returns [`Self::tauri_protocol_url`] (e.g. `tauri://localhost`) otherwise. + pub(crate) fn get_app_url(&self, https: bool) -> Cow<'_, Url> { + #[cfg(dev)] + let url = self.config.build.dev_url.as_ref(); + #[cfg(not(dev))] + let url = match self.config.build.frontend_dist.as_ref() { + Some(crate::utils::config::FrontendDist::Url(url)) => Some(url), + _ => None, + }; + + if let Some(url) = url { + Cow::Borrowed(url) + } else { + self.tauri_protocol_url(https) } } @@ -790,7 +785,7 @@ mod test { #[cfg(custom_protocol)] { assert_eq!( - manager.get_url(false).to_string(), + manager.get_app_url(false).to_string(), if cfg!(windows) || cfg!(target_os = "android") { "http://tauri.localhost/" } else { @@ -798,7 +793,7 @@ mod test { } ); assert_eq!( - manager.get_url(true).to_string(), + manager.get_app_url(true).to_string(), if cfg!(windows) || cfg!(target_os = "android") { "https://tauri.localhost/" } else { @@ -808,7 +803,10 @@ mod test { } #[cfg(dev)] - assert_eq!(manager.get_url(false).to_string(), "http://localhost:4000/"); + assert_eq!( + manager.get_app_url(false).to_string(), + "http://localhost:4000/" + ); } struct EventSetup { diff --git a/crates/tauri/src/manager/webview.rs b/crates/tauri/src/manager/webview.rs index 623b31d24..98c470b76 100644 --- a/crates/tauri/src/manager/webview.rs +++ b/crates/tauri/src/manager/webview.rs @@ -60,7 +60,7 @@ pub(crate) struct IpcJavascript<'a> { pub struct UriSchemeProtocol { /// Handler for protocol #[allow(clippy::type_complexity)] - pub protocol: + pub handler: Box, http::Request>, UriSchemeResponder) + Send + Sync>, } @@ -231,7 +231,7 @@ impl WebviewManager { app_handle: &app_handle, webview_label: webview_id, }; - (protocol.protocol)(context, request, UriSchemeResponder(responder)) + (protocol.handler)(context, request, UriSchemeResponder(responder)) }); } @@ -413,7 +413,7 @@ impl WebviewManager { #[allow(unused_mut)] // mut url only for the data-url parsing let mut url = match &pending.webview_attributes.url { WebviewUrl::App(path) => { - let app_url = app_manager.get_url(pending.webview_attributes.use_https_scheme); + let app_url = app_manager.get_app_url(pending.webview_attributes.use_https_scheme); let url = if PROXY_DEV_SERVER && is_local_network_url(&app_url) { Cow::Owned(Url::parse("tauri://localhost").unwrap()) } else { @@ -431,7 +431,7 @@ impl WebviewManager { } } WebviewUrl::External(url) => { - let config_url = app_manager.get_url(pending.webview_attributes.use_https_scheme); + let config_url = app_manager.get_app_url(pending.webview_attributes.use_https_scheme); let is_app_url = config_url.make_relative(url).is_some(); let mut url = url.clone(); if is_app_url && PROXY_DEV_SERVER && is_local_network_url(&url) { diff --git a/crates/tauri/src/plugin.rs b/crates/tauri/src/plugin.rs index 9c7f9a1ab..3a22de7bc 100644 --- a/crates/tauri/src/plugin.rs +++ b/crates/tauri/src/plugin.rs @@ -642,13 +642,13 @@ impl Builder { >( mut self, uri_scheme: N, - protocol: H, + protocol_handler: H, ) -> Self { self.uri_scheme_protocols.insert( uri_scheme.into(), Arc::new(UriSchemeProtocol { - protocol: Box::new(move |ctx, request, responder| { - responder.respond(protocol(ctx, request)) + handler: Box::new(move |ctx, request, responder| { + responder.respond(protocol_handler(ctx, request)) }), }), ); @@ -712,12 +712,12 @@ impl Builder { >( mut self, uri_scheme: N, - protocol: H, + protocol_handler: H, ) -> Self { self.uri_scheme_protocols.insert( uri_scheme.into(), Arc::new(UriSchemeProtocol { - protocol: Box::new(protocol), + handler: Box::new(protocol_handler), }), ); self diff --git a/crates/tauri/src/protocol/mod.rs b/crates/tauri/src/protocol/mod.rs index 2298bd51f..8542e2ae0 100644 --- a/crates/tauri/src/protocol/mod.rs +++ b/crates/tauri/src/protocol/mod.rs @@ -2,6 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT +//! Custom protocol handlers + #[cfg(feature = "protocol-asset")] pub mod asset; #[cfg(feature = "isolation")] diff --git a/crates/tauri/src/protocol/tauri.rs b/crates/tauri/src/protocol/tauri.rs index 52ba6119d..10cab2ced 100644 --- a/crates/tauri/src/protocol/tauri.rs +++ b/crates/tauri/src/protocol/tauri.rs @@ -32,7 +32,7 @@ pub fn get( #[cfg(all(dev, mobile))] let url = { let mut url = manager - .get_url(window_origin.starts_with("https")) + .get_app_url(window_origin.starts_with("https")) .as_str() .to_string(); if url.ends_with('/') { @@ -95,9 +95,9 @@ fn get_response( let path = path .strip_prefix("tauri://localhost") .map(|p| p.to_string()) - // the `strip_prefix` only returns None when a request is made to `https://tauri.$P` on Windows + // the `strip_prefix` only returns None when a request is made to `https://tauri.$P` on Windows and Android // where `$P` is not `localhost/*` - .unwrap_or_else(|| "".to_string()); + .unwrap_or_default(); let mut builder = HttpResponse::builder() .add_configured_headers(manager.config.app.security.headers.as_ref()) diff --git a/crates/tauri/src/webview/mod.rs b/crates/tauri/src/webview/mod.rs index 9c4a6e0ea..44d9e0a36 100644 --- a/crates/tauri/src/webview/mod.rs +++ b/crates/tauri/src/webview/mod.rs @@ -1682,7 +1682,7 @@ tauri::Builder::default() // if from `tauri://` custom protocol ({ - let protocol_url = self.manager().protocol_url(uses_https); + let protocol_url = self.manager().tauri_protocol_url(uses_https); current_url.scheme() == protocol_url.scheme() && current_url.domain() == protocol_url.domain() }) || @@ -1690,7 +1690,7 @@ tauri::Builder::default() // or if relative to `devUrl` or `frontendDist` self .manager() - .get_url(uses_https) + .get_app_url(uses_https) .make_relative(current_url) .is_some() @@ -1706,7 +1706,7 @@ tauri::Builder::default() // so we check using the first part of the domain #[cfg(any(windows, target_os = "android"))] let local = { - let protocol_url = self.manager().protocol_url(uses_https); + let protocol_url = self.manager().tauri_protocol_url(uses_https); let maybe_protocol = current_url .domain() .and_then(|d| d .split_once('.')) From 51f0fcb69cf969cbb5d47b3d92a914d897919ca0 Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Sun, 28 Dec 2025 10:40:03 +0800 Subject: [PATCH 26/57] docs: pixel units (#14702) --- crates/tauri-cli/config.schema.json | 20 +++++++++---------- crates/tauri-runtime/src/window.rs | 8 ++++---- .../schemas/config.schema.json | 20 +++++++++---------- crates/tauri-utils/src/config.rs | 20 +++++++++---------- crates/tauri/src/webview/webview_window.rs | 8 ++++---- crates/tauri/src/window/mod.rs | 8 ++++---- packages/api/src/webview.ts | 8 ++++---- packages/api/src/window.ts | 16 +++++++-------- 8 files changed, 54 insertions(+), 54 deletions(-) diff --git a/crates/tauri-cli/config.schema.json b/crates/tauri-cli/config.schema.json index 5e4a5a349..02c0bf908 100644 --- a/crates/tauri-cli/config.schema.json +++ b/crates/tauri-cli/config.schema.json @@ -262,7 +262,7 @@ "type": "boolean" }, "x": { - "description": "The horizontal position of the window's top left corner", + "description": "The horizontal position of the window's top left corner in logical pixels", "type": [ "number", "null" @@ -270,7 +270,7 @@ "format": "double" }, "y": { - "description": "The vertical position of the window's top left corner", + "description": "The vertical position of the window's top left corner in logical pixels", "type": [ "number", "null" @@ -278,19 +278,19 @@ "format": "double" }, "width": { - "description": "The window width.", + "description": "The window width in logical pixels.", "default": 800.0, "type": "number", "format": "double" }, "height": { - "description": "The window height.", + "description": "The window height in logical pixels.", "default": 600.0, "type": "number", "format": "double" }, "minWidth": { - "description": "The min window width.", + "description": "The min window width in logical pixels.", "type": [ "number", "null" @@ -298,7 +298,7 @@ "format": "double" }, "minHeight": { - "description": "The min window height.", + "description": "The min window height in logical pixels.", "type": [ "number", "null" @@ -306,7 +306,7 @@ "format": "double" }, "maxWidth": { - "description": "The max window width.", + "description": "The max window width in logical pixels.", "type": [ "number", "null" @@ -314,7 +314,7 @@ "format": "double" }, "maxHeight": { - "description": "The max window height.", + "description": "The max window height in logical pixels.", "type": [ "number", "null" @@ -652,13 +652,13 @@ ], "properties": { "width": { - "description": "Horizontal margin in physical unit", + "description": "Horizontal margin in physical pixels", "type": "integer", "format": "uint32", "minimum": 0.0 }, "height": { - "description": "Vertical margin in physical unit", + "description": "Vertical margin in physical pixels", "type": "integer", "format": "uint32", "minimum": 0.0 diff --git a/crates/tauri-runtime/src/window.rs b/crates/tauri-runtime/src/window.rs index cdda26883..652832c1e 100644 --- a/crates/tauri-runtime/src/window.rs +++ b/crates/tauri-runtime/src/window.rs @@ -247,19 +247,19 @@ pub trait WindowBuilder: WindowBuilderBase { #[must_use] fn center(self) -> Self; - /// The initial position of the window's. + /// The initial position of the window in logical pixels. #[must_use] fn position(self, x: f64, y: f64) -> Self; - /// Window size. + /// Window size in logical pixels. #[must_use] fn inner_size(self, width: f64, height: f64) -> Self; - /// Window min inner size. + /// Window min inner size in logical pixels. #[must_use] fn min_inner_size(self, min_width: f64, min_height: f64) -> Self; - /// Window max inner size. + /// Window max inner size in logical pixels. #[must_use] fn max_inner_size(self, max_width: f64, max_height: f64) -> Self; diff --git a/crates/tauri-schema-generator/schemas/config.schema.json b/crates/tauri-schema-generator/schemas/config.schema.json index 5e4a5a349..02c0bf908 100644 --- a/crates/tauri-schema-generator/schemas/config.schema.json +++ b/crates/tauri-schema-generator/schemas/config.schema.json @@ -262,7 +262,7 @@ "type": "boolean" }, "x": { - "description": "The horizontal position of the window's top left corner", + "description": "The horizontal position of the window's top left corner in logical pixels", "type": [ "number", "null" @@ -270,7 +270,7 @@ "format": "double" }, "y": { - "description": "The vertical position of the window's top left corner", + "description": "The vertical position of the window's top left corner in logical pixels", "type": [ "number", "null" @@ -278,19 +278,19 @@ "format": "double" }, "width": { - "description": "The window width.", + "description": "The window width in logical pixels.", "default": 800.0, "type": "number", "format": "double" }, "height": { - "description": "The window height.", + "description": "The window height in logical pixels.", "default": 600.0, "type": "number", "format": "double" }, "minWidth": { - "description": "The min window width.", + "description": "The min window width in logical pixels.", "type": [ "number", "null" @@ -298,7 +298,7 @@ "format": "double" }, "minHeight": { - "description": "The min window height.", + "description": "The min window height in logical pixels.", "type": [ "number", "null" @@ -306,7 +306,7 @@ "format": "double" }, "maxWidth": { - "description": "The max window width.", + "description": "The max window width in logical pixels.", "type": [ "number", "null" @@ -314,7 +314,7 @@ "format": "double" }, "maxHeight": { - "description": "The max window height.", + "description": "The max window height in logical pixels.", "type": [ "number", "null" @@ -652,13 +652,13 @@ ], "properties": { "width": { - "description": "Horizontal margin in physical unit", + "description": "Horizontal margin in physical pixels", "type": "integer", "format": "uint32", "minimum": 0.0 }, "height": { - "description": "Vertical margin in physical unit", + "description": "Vertical margin in physical pixels", "type": "integer", "format": "uint32", "minimum": 0.0 diff --git a/crates/tauri-utils/src/config.rs b/crates/tauri-utils/src/config.rs index 2c1b6938e..ada9041a6 100644 --- a/crates/tauri-utils/src/config.rs +++ b/crates/tauri-utils/src/config.rs @@ -1593,9 +1593,9 @@ pub struct WindowEffectsConfig { #[cfg_attr(feature = "schema", derive(JsonSchema))] #[serde(rename_all = "camelCase", deny_unknown_fields)] pub struct PreventOverflowMargin { - /// Horizontal margin in physical unit + /// Horizontal margin in physical pixels pub width: u32, - /// Vertical margin in physical unit + /// Vertical margin in physical pixels pub height: u32, } @@ -1673,26 +1673,26 @@ pub struct WindowConfig { /// Whether or not the window starts centered or not. #[serde(default)] pub center: bool, - /// The horizontal position of the window's top left corner + /// The horizontal position of the window's top left corner in logical pixels pub x: Option, - /// The vertical position of the window's top left corner + /// The vertical position of the window's top left corner in logical pixels pub y: Option, - /// The window width. + /// The window width in logical pixels. #[serde(default = "default_width")] pub width: f64, - /// The window height. + /// The window height in logical pixels. #[serde(default = "default_height")] pub height: f64, - /// The min window width. + /// The min window width in logical pixels. #[serde(alias = "min-width")] pub min_width: Option, - /// The min window height. + /// The min window height in logical pixels. #[serde(alias = "min-height")] pub min_height: Option, - /// The max window width. + /// The max window width in logical pixels. #[serde(alias = "max-width")] pub max_width: Option, - /// The max window height. + /// The max window height in logical pixels. #[serde(alias = "max-height")] pub max_height: Option, /// Whether or not to prevent the window from overflowing the workarea diff --git a/crates/tauri/src/webview/webview_window.rs b/crates/tauri/src/webview/webview_window.rs index 24232993a..f3c8665c3 100644 --- a/crates/tauri/src/webview/webview_window.rs +++ b/crates/tauri/src/webview/webview_window.rs @@ -465,28 +465,28 @@ impl<'a, R: Runtime, M: Manager> WebviewWindowBuilder<'a, R, M> { self } - /// The initial position of the window's. + /// The initial position of the window in logical pixels. #[must_use] pub fn position(mut self, x: f64, y: f64) -> Self { self.window_builder = self.window_builder.position(x, y); self } - /// Window size. + /// Window size in logical pixels. #[must_use] pub fn inner_size(mut self, width: f64, height: f64) -> Self { self.window_builder = self.window_builder.inner_size(width, height); self } - /// Window min inner size. + /// Window min inner size in logical pixels. #[must_use] pub fn min_inner_size(mut self, min_width: f64, min_height: f64) -> Self { self.window_builder = self.window_builder.min_inner_size(min_width, min_height); self } - /// Window max inner size. + /// Window max inner size in logical pixels. #[must_use] pub fn max_inner_size(mut self, max_width: f64, max_height: f64) -> Self { self.window_builder = self.window_builder.max_inner_size(max_width, max_height); diff --git a/crates/tauri/src/window/mod.rs b/crates/tauri/src/window/mod.rs index 9e74e694b..a67784cc3 100644 --- a/crates/tauri/src/window/mod.rs +++ b/crates/tauri/src/window/mod.rs @@ -443,28 +443,28 @@ impl<'a, R: Runtime, M: Manager> WindowBuilder<'a, R, M> { self } - /// The initial position of the window's. + /// The initial position of the window in logical pixels. #[must_use] pub fn position(mut self, x: f64, y: f64) -> Self { self.window_builder = self.window_builder.position(x, y); self } - /// Window size. + /// Window size in logical pixels. #[must_use] pub fn inner_size(mut self, width: f64, height: f64) -> Self { self.window_builder = self.window_builder.inner_size(width, height); self } - /// Window min inner size. + /// Window min inner size in logical pixels. #[must_use] pub fn min_inner_size(mut self, min_width: f64, min_height: f64) -> Self { self.window_builder = self.window_builder.min_inner_size(min_width, min_height); self } - /// Window max inner size. + /// Window max inner size in logical pixels. #[must_use] pub fn max_inner_size(mut self, max_width: f64, max_height: f64) -> Self { self.window_builder = self.window_builder.max_inner_size(max_width, max_height); diff --git a/packages/api/src/webview.ts b/packages/api/src/webview.ts index cf78dffe6..47a497fb6 100644 --- a/packages/api/src/webview.ts +++ b/packages/api/src/webview.ts @@ -714,13 +714,13 @@ interface WebviewOptions { * - local file path or route such as `/path/to/page.html` or `/users` is appended to the application URL (the devServer URL on development, or `tauri://localhost/` and `https://tauri.localhost/` on production). */ url?: string - /** The initial vertical position. */ + /** The initial vertical position in logical pixels. */ x: number - /** The initial horizontal position. */ + /** The initial horizontal position in logical pixels. */ y: number - /** The initial width. */ + /** The initial width in logical pixels. */ width: number - /** The initial height. */ + /** The initial height in logical pixels. */ height: number /** * Whether the webview is transparent or not. diff --git a/packages/api/src/window.ts b/packages/api/src/window.ts index 090108337..8a11d2cc3 100644 --- a/packages/api/src/window.ts +++ b/packages/api/src/window.ts @@ -2305,21 +2305,21 @@ interface PreventOverflowMargin { interface WindowOptions { /** Show window in the center of the screen.. */ center?: boolean - /** The initial vertical position. Only applies if `y` is also set. */ + /** The initial vertical position in logical pixels. Only applies if `y` is also set. */ x?: number - /** The initial horizontal position. Only applies if `x` is also set. */ + /** The initial horizontal position in logical pixels. Only applies if `x` is also set. */ y?: number - /** The initial width. */ + /** The initial width in logical pixels. */ width?: number - /** The initial height. */ + /** The initial height in logical pixels. */ height?: number - /** The minimum width. Only applies if `minHeight` is also set. */ + /** The minimum width in logical pixels. Only applies if `minHeight` is also set. */ minWidth?: number - /** The minimum height. Only applies if `minWidth` is also set. */ + /** The minimum height in logical pixels. Only applies if `minWidth` is also set. */ minHeight?: number - /** The maximum width. Only applies if `maxHeight` is also set. */ + /** The maximum width in logical pixels. Only applies if `maxHeight` is also set. */ maxWidth?: number - /** The maximum height. Only applies if `maxWidth` is also set. */ + /** The maximum height in logical pixels. Only applies if `maxWidth` is also set. */ maxHeight?: number /** * Prevent the window from overflowing the working area (e.g. monitor size - taskbar size) From a2abe2e6bcb9e1eed8484240dfdb76a5bc28ae58 Mon Sep 17 00:00:00 2001 From: sftse Date: Mon, 29 Dec 2025 06:54:51 +0100 Subject: [PATCH 27/57] refactor(cli): simplify `features: Option>` to `Vec` (#14607) * refactor: use empty vector for features instead of None * refactor: reorder * add change file * comment: highlight places where serialization is used * refactor: simplify serialization * Update .changes/empty-vec-instead-of-none.md * Update crates/tauri-cli/src/mobile/ios/mod.rs --------- Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com> --- .changes/empty-vec-instead-of-none.md | 6 ++++ crates/tauri-cli/src/build.rs | 5 ++-- crates/tauri-cli/src/bundle.rs | 2 +- crates/tauri-cli/src/dev.rs | 6 ++-- crates/tauri-cli/src/interface/mod.rs | 2 +- crates/tauri-cli/src/interface/rust.rs | 30 +++++++------------ .../tauri-cli/src/interface/rust/desktop.rs | 4 +-- .../mobile/android/android_studio_script.rs | 2 +- crates/tauri-cli/src/mobile/android/build.rs | 4 +-- crates/tauri-cli/src/mobile/android/dev.rs | 2 +- crates/tauri-cli/src/mobile/android/mod.rs | 19 +++++------- crates/tauri-cli/src/mobile/android/run.rs | 2 +- crates/tauri-cli/src/mobile/init.rs | 4 +-- crates/tauri-cli/src/mobile/ios/build.rs | 4 +-- crates/tauri-cli/src/mobile/ios/dev.rs | 4 +-- crates/tauri-cli/src/mobile/ios/mod.rs | 21 +++++++------ crates/tauri-cli/src/mobile/ios/run.rs | 4 +-- .../tauri-cli/src/mobile/ios/xcode_script.rs | 2 +- crates/tauri-cli/src/mobile/mod.rs | 4 +-- 19 files changed, 57 insertions(+), 70 deletions(-) create mode 100644 .changes/empty-vec-instead-of-none.md diff --git a/.changes/empty-vec-instead-of-none.md b/.changes/empty-vec-instead-of-none.md new file mode 100644 index 000000000..6b0dd9fd9 --- /dev/null +++ b/.changes/empty-vec-instead-of-none.md @@ -0,0 +1,6 @@ +--- +"@tauri-apps/cli": patch:enhance +"tauri-cli": patch:enhance +--- + +Simplified internal representation of `features: Option>` with `Vec`, no user facing changes diff --git a/crates/tauri-cli/src/build.rs b/crates/tauri-cli/src/build.rs index ac8c5552a..0bd5a5320 100644 --- a/crates/tauri-cli/src/build.rs +++ b/crates/tauri-cli/src/build.rs @@ -40,7 +40,7 @@ pub struct Options { pub target: Option, /// Space or comma separated list of features to activate #[clap(short, long, action = ArgAction::Append, num_args(0..))] - pub features: Option>, + pub features: Vec, /// Space or comma separated list of bundles to package. #[clap(short, long, action = ArgAction::Append, num_args(0..), value_delimiter = ',')] pub bundles: Option>, @@ -252,8 +252,7 @@ pub fn setup( options .features - .get_or_insert(Vec::new()) - .extend(config.build.features.clone().unwrap_or_default()); + .extend_from_slice(config.build.features.as_deref().unwrap_or_default()); interface.build_options(&mut options.args, &mut options.features, mobile); Ok(()) diff --git a/crates/tauri-cli/src/bundle.rs b/crates/tauri-cli/src/bundle.rs index 646f44ddb..8c1f320b5 100644 --- a/crates/tauri-cli/src/bundle.rs +++ b/crates/tauri-cli/src/bundle.rs @@ -71,7 +71,7 @@ pub struct Options { pub config: Vec, /// Space or comma separated list of features, should be the same features passed to `tauri build` if any. #[clap(short, long, action = ArgAction::Append, num_args(0..))] - pub features: Option>, + pub features: Vec, /// Target triple to build against. /// /// It must be one of the values outputted by `$rustc --print target-list` or `universal-apple-darwin` for an universal macOS application. diff --git a/crates/tauri-cli/src/dev.rs b/crates/tauri-cli/src/dev.rs index 7ebabb458..e2ac61fce 100644 --- a/crates/tauri-cli/src/dev.rs +++ b/crates/tauri-cli/src/dev.rs @@ -57,7 +57,7 @@ pub struct Options { pub target: Option, /// List of cargo features to activate #[clap(short, long, action = ArgAction::Append, num_args(0..))] - pub features: Option>, + pub features: Vec, /// Exit on panic #[clap(short, long)] pub exit_on_panic: bool, @@ -254,9 +254,7 @@ pub fn setup(interface: &AppInterface, options: &mut Options, config: ConfigHand .features .clone() .unwrap_or_default(); - if let Some(features) = &options.features { - cargo_features.extend(features.clone()); - } + cargo_features.extend(options.features.clone()); let mut dev_url = config .lock() diff --git a/crates/tauri-cli/src/interface/mod.rs b/crates/tauri-cli/src/interface/mod.rs index 00ca4c3d1..b153b33bf 100644 --- a/crates/tauri-cli/src/interface/mod.rs +++ b/crates/tauri-cli/src/interface/mod.rs @@ -46,7 +46,7 @@ pub trait AppSettings { package_types: Vec, ) -> crate::Result { let no_default_features = options.args.contains(&"--no-default-features".into()); - let mut enabled_features = options.features.clone().unwrap_or_default(); + let mut enabled_features = options.features.clone(); if !no_default_features { enabled_features.push("default".into()); } diff --git a/crates/tauri-cli/src/interface/rust.rs b/crates/tauri-cli/src/interface/rust.rs index 0f7d2fd02..801e18767 100644 --- a/crates/tauri-cli/src/interface/rust.rs +++ b/crates/tauri-cli/src/interface/rust.rs @@ -51,7 +51,7 @@ pub struct Options { pub runner: Option, pub debug: bool, pub target: Option, - pub features: Option>, + pub features: Vec, pub args: Vec, pub config: Vec, pub no_watch: bool, @@ -108,7 +108,7 @@ impl From for Options { #[derive(Debug, Clone)] pub struct MobileOptions { pub debug: bool, - pub features: Option>, + pub features: Vec, pub args: Vec, pub config: Vec, pub no_watch: bool, @@ -393,7 +393,7 @@ fn dev_options( mobile: bool, args: &mut Vec, run_args: &mut Vec, - features: &mut Option>, + features: &mut Vec, app_settings: &RustAppSettings, ) { let mut dev_args = Vec::new(); @@ -429,9 +429,7 @@ fn dev_options( }) .collect(); args.push("--no-default-features".into()); - if !enable_features.is_empty() { - features.get_or_insert(Vec::new()).extend(enable_features); - } + features.extend(enable_features); } } @@ -498,15 +496,8 @@ fn get_watch_folders(additional_watch_folders: &[PathBuf]) -> crate::Result, - features: &mut Option>, - mobile: bool, - ) { - features - .get_or_insert(Vec::new()) - .push("tauri/custom-protocol".into()); + pub fn build_options(&self, args: &mut Vec, features: &mut Vec, mobile: bool) { + features.push("tauri/custom-protocol".into()); if mobile { args.push("--lib".into()); } else { @@ -957,11 +948,12 @@ impl AppSettings for RustAppSettings { .clone() .unwrap_or_default(); for bin in bins { - if let (Some(req_features), Some(opt_features)) = - (&bin.required_features, &options.features) - { + if let Some(req_features) = &bin.required_features { // Check if all required features are enabled. - if !req_features.iter().all(|feat| opt_features.contains(feat)) { + if !req_features + .iter() + .all(|feat| options.features.contains(feat)) + { continue; } } diff --git a/crates/tauri-cli/src/interface/rust/desktop.rs b/crates/tauri-cli/src/interface/rust/desktop.rs index e747f236b..b372dc015 100644 --- a/crates/tauri-cli/src/interface/rust/desktop.rs +++ b/crates/tauri-cli/src/interface/rust/desktop.rs @@ -262,9 +262,7 @@ fn cargo_command( build_cmd.args(&options.args); let mut features = config_features; - if let Some(f) = options.features { - features.extend(f); - } + features.extend(options.features); if !features.is_empty() { build_cmd.arg("--features"); build_cmd.arg(features.join(",")); diff --git a/crates/tauri-cli/src/mobile/android/android_studio_script.rs b/crates/tauri-cli/src/mobile/android/android_studio_script.rs index c3dfdff4b..4657ac673 100644 --- a/crates/tauri-cli/src/mobile/android/android_studio_script.rs +++ b/crates/tauri-cli/src/mobile/android/android_studio_script.rs @@ -80,7 +80,7 @@ pub fn command(options: Options) -> Result<()> { &AppInterface::new(tauri_config_, None)?, ), tauri_config_, - None, + &[], &cli_options, ); (config, metadata) diff --git a/crates/tauri-cli/src/mobile/android/build.rs b/crates/tauri-cli/src/mobile/android/build.rs index 4aae6df68..c91ba73c1 100644 --- a/crates/tauri-cli/src/mobile/android/build.rs +++ b/crates/tauri-cli/src/mobile/android/build.rs @@ -48,7 +48,7 @@ pub struct Options { pub targets: Option>, /// List of cargo features to activate #[clap(short, long, action = ArgAction::Append, num_args(0..))] - pub features: Option>, + pub features: Vec, /// JSON strings or paths to JSON, JSON5 or TOML files to merge with the default configuration file /// /// Configurations are merged in the order they are provided, which means a particular value overwrites previous values when a config key-value pair conflicts. @@ -152,7 +152,7 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result>, + pub features: Vec, /// Exit on panic #[clap(short, long)] exit_on_panic: bool, diff --git a/crates/tauri-cli/src/mobile/android/mod.rs b/crates/tauri-cli/src/mobile/android/mod.rs index 1990cf2f4..9a73f91e0 100644 --- a/crates/tauri-cli/src/mobile/android/mod.rs +++ b/crates/tauri-cli/src/mobile/android/mod.rs @@ -128,19 +128,14 @@ pub fn command(cli: Cli, verbosity: u8) -> Result<()> { pub fn get_config( app: &App, config: &TauriConfig, - features: Option<&Vec>, + features: &[String], cli_options: &CliOptions, ) -> (AndroidConfig, AndroidMetadata) { let mut android_options = cli_options.clone(); - if let Some(features) = features { - android_options - .features - .get_or_insert(Vec::new()) - .extend_from_slice(features); - } + android_options.features.extend_from_slice(features); let raw = RawAndroidConfig { - features: android_options.features.clone(), + features: Some(android_options.features.clone()), logcat_filter_specs: vec![ "RustStdoutStderr".into(), format!( @@ -161,7 +156,7 @@ pub fn get_config( let metadata = AndroidMetadata { supported: true, cargo_args: Some(android_options.args), - features: android_options.features, + features: Some(android_options.features), ..Default::default() }; @@ -257,8 +252,8 @@ fn ensure_java() -> Result<()> { fn ensure_sdk(non_interactive: bool) -> Result<()> { let android_home = std::env::var_os("ANDROID_HOME") - .map(PathBuf::from) - .or_else(|| std::env::var_os("ANDROID_SDK_ROOT").map(PathBuf::from)); + .or_else(|| std::env::var_os("ANDROID_SDK_ROOT")) + .map(PathBuf::from); if !android_home.as_ref().is_some_and(|v| v.exists()) { log::info!( "ANDROID_HOME {}, trying to locate Android SDK...", @@ -354,8 +349,8 @@ fn ensure_sdk(non_interactive: bool) -> Result<()> { fn ensure_ndk(non_interactive: bool) -> Result<()> { // re-evaluate ANDROID_HOME let android_home = std::env::var_os("ANDROID_HOME") + .or_else(|| std::env::var_os("ANDROID_SDK_ROOT")) .map(PathBuf::from) - .or_else(|| std::env::var_os("ANDROID_SDK_ROOT").map(PathBuf::from)) .context("Failed to locate Android SDK")?; let mut installed_ndks = read_dir(android_home.join("ndk")) .map(|dir| { diff --git a/crates/tauri-cli/src/mobile/android/run.rs b/crates/tauri-cli/src/mobile/android/run.rs index 9c276c4d9..8bab82b84 100644 --- a/crates/tauri-cli/src/mobile/android/run.rs +++ b/crates/tauri-cli/src/mobile/android/run.rs @@ -29,7 +29,7 @@ pub struct Options { pub release: bool, /// List of cargo features to activate #[clap(short, long, action = ArgAction::Append, num_args(0..))] - pub features: Option>, + pub features: Vec, /// JSON strings or paths to JSON, JSON5 or TOML files to merge with the default configuration file /// /// Configurations are merged in the order they are provided, which means a particular value overwrites previous values when a config key-value pair conflicts. diff --git a/crates/tauri-cli/src/mobile/init.rs b/crates/tauri-cli/src/mobile/init.rs index 2a3cab0b4..eef38d1e9 100644 --- a/crates/tauri-cli/src/mobile/init.rs +++ b/crates/tauri-cli/src/mobile/init.rs @@ -135,7 +135,7 @@ pub fn exec( Target::Android => { let _env = super::android::env(non_interactive)?; let (config, metadata) = - super::android::get_config(&app, tauri_config_, None, &Default::default()); + super::android::get_config(&app, tauri_config_, &[], &Default::default()); map.insert("android", &config); super::android::project::gen( &config, @@ -150,7 +150,7 @@ pub fn exec( // Generate Xcode project Target::Ios => { let (config, metadata) = - super::ios::get_config(&app, tauri_config_, None, &Default::default())?; + super::ios::get_config(&app, tauri_config_, &[], &Default::default())?; map.insert("apple", &config); super::ios::project::gen( tauri_config_, diff --git a/crates/tauri-cli/src/mobile/ios/build.rs b/crates/tauri-cli/src/mobile/ios/build.rs index f52f892d1..e8348726b 100644 --- a/crates/tauri-cli/src/mobile/ios/build.rs +++ b/crates/tauri-cli/src/mobile/ios/build.rs @@ -60,7 +60,7 @@ pub struct Options { pub targets: Option>, /// List of cargo features to activate #[clap(short, long, action = ArgAction::Append, num_args(0..))] - pub features: Option>, + pub features: Vec, /// JSON strings or paths to JSON, JSON5 or TOML files to merge with the default configuration file /// /// Configurations are merged in the order they are provided, which means a particular value overwrites previous values when a config key-value pair conflicts. @@ -201,7 +201,7 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result>, + pub features: Vec, /// Exit on panic #[clap(short, long)] exit_on_panic: bool, @@ -197,7 +197,7 @@ fn run_command(options: Options, noise_level: NoiseLevel) -> Result<()> { let (config, _metadata) = get_config( &app, tauri_config_, - dev_options.features.as_ref(), + &dev_options.features, &Default::default(), )?; diff --git a/crates/tauri-cli/src/mobile/ios/mod.rs b/crates/tauri-cli/src/mobile/ios/mod.rs index ca4aade41..d589f76a6 100644 --- a/crates/tauri-cli/src/mobile/ios/mod.rs +++ b/crates/tauri-cli/src/mobile/ios/mod.rs @@ -40,7 +40,7 @@ use crate::{ use std::{ env::{set_var, var_os}, fs::create_dir_all, - path::PathBuf, + path::Path, str::FromStr, thread::sleep, time::Duration, @@ -126,16 +126,11 @@ pub fn command(cli: Cli, verbosity: u8) -> Result<()> { pub fn get_config( app: &App, tauri_config: &TauriConfig, - features: Option<&Vec>, + features: &[String], cli_options: &CliOptions, ) -> Result<(AppleConfig, AppleMetadata)> { let mut ios_options = cli_options.clone(); - if let Some(features) = features { - ios_options - .features - .get_or_insert(Vec::new()) - .extend_from_slice(features); - } + ios_options.features.extend_from_slice(features); let bundle_version = if let Some(bundle_version) = tauri_config .bundle @@ -232,7 +227,7 @@ pub fn get_config( } } }), - ios_features: ios_options.features.clone(), + ios_features: Some(ios_options.features.clone()), bundle_version, bundle_version_short, ios_version: Some(tauri_config.bundle.ios.minimum_system_version.clone()), @@ -252,7 +247,7 @@ pub fn get_config( .clone() .unwrap_or_default() { - let framework_path = PathBuf::from(&framework); + let framework_path = Path::new(&framework); let ext = framework_path.extension().unwrap_or_default(); if ext.is_empty() { frameworks.push(framework); @@ -277,7 +272,11 @@ pub fn get_config( supported: true, ios: ApplePlatform { cargo_args: Some(ios_options.args), - features: ios_options.features, + features: if ios_options.features.is_empty() { + None + } else { + Some(ios_options.features) + }, frameworks: Some(frameworks), vendor_frameworks: Some(vendor_frameworks), ..Default::default() diff --git a/crates/tauri-cli/src/mobile/ios/run.rs b/crates/tauri-cli/src/mobile/ios/run.rs index 0ae1cef12..844e2f4c8 100644 --- a/crates/tauri-cli/src/mobile/ios/run.rs +++ b/crates/tauri-cli/src/mobile/ios/run.rs @@ -26,7 +26,7 @@ pub struct Options { pub release: bool, /// List of cargo features to activate #[clap(short, long, action = ArgAction::Append, num_args(0..))] - pub features: Option>, + pub features: Vec, /// JSON strings or paths to JSON, JSON5 or TOML files to merge with the default configuration file /// /// Configurations are merged in the order they are provided, which means a particular value overwrites previous values when a config key-value pair conflicts. @@ -77,7 +77,7 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> { super::build::Options { debug: !options.release, targets: Some(vec![]), /* skips IPA build since there's no target */ - features: None, + features: Vec::new(), config: options.config.clone(), build_number: None, open: options.open, diff --git a/crates/tauri-cli/src/mobile/ios/xcode_script.rs b/crates/tauri-cli/src/mobile/ios/xcode_script.rs index 34d697614..25955c5ae 100644 --- a/crates/tauri-cli/src/mobile/ios/xcode_script.rs +++ b/crates/tauri-cli/src/mobile/ios/xcode_script.rs @@ -128,7 +128,7 @@ pub fn command(options: Options) -> Result<()> { &AppInterface::new(tauri_config_, None)?, ), tauri_config_, - None, + &[], &cli_options, )?; (config, metadata) diff --git a/crates/tauri-cli/src/mobile/mod.rs b/crates/tauri-cli/src/mobile/mod.rs index 2a20c66b6..b94543d65 100644 --- a/crates/tauri-cli/src/mobile/mod.rs +++ b/crates/tauri-cli/src/mobile/mod.rs @@ -181,7 +181,7 @@ impl Default for DevHost { #[derive(Debug, Clone, Serialize, Deserialize)] pub struct CliOptions { pub dev: bool, - pub features: Option>, + pub features: Vec, pub args: Vec, pub noise_level: NoiseLevel, pub vars: HashMap, @@ -193,7 +193,7 @@ impl Default for CliOptions { fn default() -> Self { Self { dev: false, - features: None, + features: Vec::new(), args: vec!["--lib".into()], noise_level: Default::default(), vars: Default::default(), From 8a43e4f9d90450e5a262fb59f5688f2c420d41ed Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Mon, 29 Dec 2025 19:43:09 +0800 Subject: [PATCH 28/57] refactor: use u64 instead of usize for nonce gen (#14708) --- crates/tauri/src/manager/mod.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/crates/tauri/src/manager/mod.rs b/crates/tauri/src/manager/mod.rs index 9973ef46d..25ae8eaab 100644 --- a/crates/tauri/src/manager/mod.rs +++ b/crates/tauri/src/manager/mod.rs @@ -129,14 +129,7 @@ fn replace_csp_nonce( ) { let mut nonces = Vec::new(); *asset = replace_with_callback(asset, token, || { - #[cfg(target_pointer_width = "64")] - let mut raw = [0u8; 8]; - #[cfg(target_pointer_width = "32")] - let mut raw = [0u8; 4]; - #[cfg(target_pointer_width = "16")] - let mut raw = [0u8; 2]; - getrandom::fill(&mut raw).expect("failed to get random bytes"); - let nonce = usize::from_ne_bytes(raw); + let nonce = getrandom::u64().expect("failed to get random bytes"); nonces.push(nonce); nonce.to_string() }); From 1dbf6fd067f418f73015cb751a35dbe3cfa4ed4f Mon Sep 17 00:00:00 2001 From: Bruno Verachten Date: Mon, 29 Dec 2025 14:21:49 +0100 Subject: [PATCH 29/57] feat(cli): add RISC-V 64-bit pre-built binary support (#14685) * feat(cli): add RISC-V 64-bit pre-built binary support Add riscv64gc-unknown-linux-gnu target to the tauri-cli release workflow, enabling pre-built binaries for RISC-V 64-bit Linux systems. This eliminates the multi-hour QEMU compilation time that currently blocks RISC-V adoption of Tauri apps. Native compilation on RISC-V hardware takes ~63 minutes. Changes: - Add RISC-V entry to build matrix with self-hosted runner support - Support custom `runs_on` field for matrix entries (falls back to `os`) - Skip dtolnay/rust-toolchain and rust-cache for self-hosted runners - Source ~/.cargo/env for self-hosted runners where Rust is pre-installed Tested on: - Hardware: Banana Pi F3 (RISC-V64, 16GB RAM) - OS: Debian Trixie (required for WebKit2GTK RISC-V support) - Build time: 1h 2m 28s - Binary: ELF 64-bit RISC-V, 16MB stripped * feat(cli): use cross for RISC-V cross-compilation Switch from self-hosted runners to cross-rs for building RISC-V binaries. This approach is simpler and doesn't require maintaining self-hosted infrastructure. Local testing confirms cross builds a valid RISC-V binary in ~4 minutes. * refactor(cli): address review feedback for RISC-V workflow - Skip Rust toolchain and cache setup for cross builds (unnecessary) - Pin cross version to 0.2.5 for reproducibility - Fix Linux dependencies condition to match ubuntu-* variants --- .github/workflows/publish-cli-rs.yml | 29 +++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-cli-rs.yml b/.github/workflows/publish-cli-rs.yml index a6471161c..39887eec7 100644 --- a/.github/workflows/publish-cli-rs.yml +++ b/.github/workflows/publish-cli-rs.yml @@ -38,35 +38,62 @@ jobs: rust_target: aarch64-pc-windows-msvc ext: '.exe' args: '' + - os: ubuntu-22.04 + rust_target: riscv64gc-unknown-linux-gnu + ext: '' + args: '' + cross: true steps: - uses: actions/checkout@v4 - name: 'Setup Rust' + if: ${{ !matrix.config.cross }} uses: dtolnay/rust-toolchain@stable with: targets: ${{ matrix.config.rust_target }} - uses: Swatinem/rust-cache@v2 + if: ${{ !matrix.config.cross }} with: key: ${{ matrix.config.rust_target }} - name: install Linux dependencies - if: matrix.config.os == 'ubuntu-latest' + if: ${{ !matrix.config.cross && startsWith(matrix.config.os, 'ubuntu') }} run: | sudo apt-get update sudo apt-get install -y libgtk-3-dev + - name: Install cross + if: ${{ matrix.config.cross }} + uses: taiki-e/install-action@v2 + with: + tool: cross@0.2.5 + - name: Build CLI + if: ${{ !matrix.config.cross }} run: cargo build --manifest-path ./crates/tauri-cli/Cargo.toml --profile release-size-optimized ${{ matrix.config.args }} + - name: Build CLI (cross) + if: ${{ matrix.config.cross }} + run: cross build --manifest-path ./crates/tauri-cli/Cargo.toml --target ${{ matrix.config.rust_target }} --profile release-size-optimized ${{ matrix.config.args }} + - name: Upload CLI + if: ${{ !matrix.config.cross }} uses: actions/upload-artifact@v4 with: name: cargo-tauri-${{ matrix.config.rust_target }}${{ matrix.config.ext }} path: target/release-size-optimized/cargo-tauri${{ matrix.config.ext }} if-no-files-found: error + - name: Upload CLI (cross) + if: ${{ matrix.config.cross }} + uses: actions/upload-artifact@v4 + with: + name: cargo-tauri-${{ matrix.config.rust_target }}${{ matrix.config.ext }} + path: target/${{ matrix.config.rust_target }}/release-size-optimized/cargo-tauri${{ matrix.config.ext }} + if-no-files-found: error + upload: needs: build runs-on: ubuntu-latest From 9b242e40c844189c877a91e513ae6196202d5ae9 Mon Sep 17 00:00:00 2001 From: Camilla F Date: Mon, 29 Dec 2025 16:29:07 +0000 Subject: [PATCH 30/57] fix: BSD support in tauri-runtime (#14700) Co-authored-by: Fabian-Lars --- .changes/runtime-bsd.md | 6 +++++ crates/tauri-runtime-wry/src/lib.rs | 34 +++++++++++++++++++++++---- crates/tauri-runtime/src/lib.rs | 21 +++++++++++++++-- crates/tauri/src/test/mock_runtime.rs | 9 ++++++- 4 files changed, 63 insertions(+), 7 deletions(-) create mode 100644 .changes/runtime-bsd.md diff --git a/.changes/runtime-bsd.md b/.changes/runtime-bsd.md new file mode 100644 index 000000000..c9c97b4c4 --- /dev/null +++ b/.changes/runtime-bsd.md @@ -0,0 +1,6 @@ +--- +tauri-runtime: patch:bug +tauri-runtime-wry: patch:bug +--- + +Fix compilation errors when targeting BSD. diff --git a/crates/tauri-runtime-wry/src/lib.rs b/crates/tauri-runtime-wry/src/lib.rs index 821fbacec..61799d039 100644 --- a/crates/tauri-runtime-wry/src/lib.rs +++ b/crates/tauri-runtime-wry/src/lib.rs @@ -37,7 +37,13 @@ use tauri_runtime::{ use objc2::rc::Retained; #[cfg(target_os = "macos")] use tao::platform::macos::{EventLoopWindowTargetExtMacOS, WindowBuilderExtMacOS}; -#[cfg(target_os = "linux")] +#[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" +))] use tao::platform::unix::{WindowBuilderExtUnix, WindowExtUnix}; #[cfg(windows)] use tao::platform::windows::{WindowBuilderExtWindows, WindowExtWindows}; @@ -862,7 +868,13 @@ impl WindowBuilder for WindowBuilderWrapper { "); } - #[cfg(target_os = "linux")] + #[cfg(any( + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] { // Mouse event is disabled on Linux since sudden event bursts could block event loop. window.inner = window.inner.with_cursor_moved_event(false); @@ -1194,7 +1206,14 @@ impl WindowBuilder for WindowBuilderWrapper { self } - #[cfg(any(windows, target_os = "linux"))] + #[cfg(any( + windows, + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] fn skip_taskbar(mut self, skip: bool) -> Self { self.inner = self.inner.with_skip_taskbar(skip); self @@ -3417,7 +3436,14 @@ fn handle_user_message( } #[allow(unused_variables)] WindowMessage::SetSkipTaskbar(skip) => { - #[cfg(any(windows, target_os = "linux"))] + #[cfg(any( + windows, + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] let _ = window.set_skip_taskbar(skip); } WindowMessage::SetCursorGrab(grab) => { diff --git a/crates/tauri-runtime/src/lib.rs b/crates/tauri-runtime/src/lib.rs index 2874d16b9..5bf869dcd 100644 --- a/crates/tauri-runtime/src/lib.rs +++ b/crates/tauri-runtime/src/lib.rs @@ -399,8 +399,25 @@ pub trait Runtime: Debug + Sized + 'static { fn new(args: RuntimeInitArgs) -> Result; /// Creates a new webview runtime on any thread. - #[cfg(any(windows, target_os = "linux"))] - #[cfg_attr(docsrs, doc(cfg(any(windows, target_os = "linux"))))] + #[cfg(any( + windows, + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] + #[cfg_attr( + docsrs, + doc(cfg(any( + windows, + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))) + )] fn new_any_thread(args: RuntimeInitArgs) -> Result; /// Creates an `EventLoopProxy` that can be used to dispatch user events to the main event loop. diff --git a/crates/tauri/src/test/mock_runtime.rs b/crates/tauri/src/test/mock_runtime.rs index 16b136ef7..5fbedd013 100644 --- a/crates/tauri/src/test/mock_runtime.rs +++ b/crates/tauri/src/test/mock_runtime.rs @@ -1146,7 +1146,14 @@ impl Runtime for MockRuntime { Ok(Self::init()) } - #[cfg(any(windows, target_os = "linux"))] + #[cfg(any( + windows, + target_os = "linux", + target_os = "dragonfly", + target_os = "freebsd", + target_os = "netbsd", + target_os = "openbsd" + ))] fn new_any_thread(_args: RuntimeInitArgs) -> Result { Ok(Self::init()) } From dcd1a6588948bf42d31ddab94109068605965337 Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Fri, 2 Jan 2026 16:02:23 +0100 Subject: [PATCH 31/57] chore: fix tests (#14720) * chore: fix tests * windows --- Cargo.lock | 1 + crates/tauri-cli/config.schema.json | 2 +- crates/tauri-schema-generator/schemas/config.schema.json | 2 +- crates/tauri-utils/Cargo.toml | 1 + crates/tauri-utils/src/config.rs | 2 +- .../acl_tests__tests__platform-specific-permissions.snap | 1 + 6 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 50bead4b4..929c91254 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8978,6 +8978,7 @@ dependencies = [ "serial_test", "serialize-to-javascript", "swift-rs", + "tauri", "thiserror 2.0.12", "toml 0.9.10+spec-1.1.0", "url", diff --git a/crates/tauri-cli/config.schema.json b/crates/tauri-cli/config.schema.json index 02c0bf908..58fab551a 100644 --- a/crates/tauri-cli/config.schema.json +++ b/crates/tauri-cli/config.schema.json @@ -165,7 +165,7 @@ "type": "object", "properties": { "windows": { - "description": "The app windows configuration.\n\n ## Example:\n\n To create a window at app startup\n\n ```json\n {\n \"app\": {\n \"windows\": [\n { \"width\": 800, \"height\": 600 }\n ]\n }\n }\n ```\n\n If not specified, the window's label (its identifier) defaults to \"main\",\n you can use this label to get the window through\n `app.get_webview_window` in Rust or `WebviewWindow.getByLabel` in JavaScript\n\n When working with multiple windows, each window will need an unique label\n\n ```json\n {\n \"app\": {\n \"windows\": [\n { \"label\": \"main\", \"width\": 800, \"height\": 600 },\n { \"label\": \"secondary\", \"width\": 800, \"height\": 600 }\n ]\n }\n }\n ```\n\n You can also set `create` to false and use this config through the Rust APIs\n\n ```json\n {\n \"app\": {\n \"windows\": [\n { \"create\": false, \"width\": 800, \"height\": 600 }\n ]\n }\n }\n ```\n\n and use it like this\n\n ```rust\n tauri::Builder::default()\n .setup(|app| {\n tauri::WebviewWindowBuilder::from_config(app.handle(), app.config().app.windows[0])?.build()?;\n Ok(())\n });\n ```", + "description": "The app windows configuration.\n\n ## Example:\n\n To create a window at app startup\n\n ```json\n {\n \"app\": {\n \"windows\": [\n { \"width\": 800, \"height\": 600 }\n ]\n }\n }\n ```\n\n If not specified, the window's label (its identifier) defaults to \"main\",\n you can use this label to get the window through\n `app.get_webview_window` in Rust or `WebviewWindow.getByLabel` in JavaScript\n\n When working with multiple windows, each window will need an unique label\n\n ```json\n {\n \"app\": {\n \"windows\": [\n { \"label\": \"main\", \"width\": 800, \"height\": 600 },\n { \"label\": \"secondary\", \"width\": 800, \"height\": 600 }\n ]\n }\n }\n ```\n\n You can also set `create` to false and use this config through the Rust APIs\n\n ```json\n {\n \"app\": {\n \"windows\": [\n { \"create\": false, \"width\": 800, \"height\": 600 }\n ]\n }\n }\n ```\n\n and use it like this\n\n ```rust\n tauri::Builder::default()\n .setup(|app| {\n tauri::WebviewWindowBuilder::from_config(app.handle(), &app.config().app.windows[0])?.build()?;\n Ok(())\n });\n ```", "default": [], "type": "array", "items": { diff --git a/crates/tauri-schema-generator/schemas/config.schema.json b/crates/tauri-schema-generator/schemas/config.schema.json index 02c0bf908..58fab551a 100644 --- a/crates/tauri-schema-generator/schemas/config.schema.json +++ b/crates/tauri-schema-generator/schemas/config.schema.json @@ -165,7 +165,7 @@ "type": "object", "properties": { "windows": { - "description": "The app windows configuration.\n\n ## Example:\n\n To create a window at app startup\n\n ```json\n {\n \"app\": {\n \"windows\": [\n { \"width\": 800, \"height\": 600 }\n ]\n }\n }\n ```\n\n If not specified, the window's label (its identifier) defaults to \"main\",\n you can use this label to get the window through\n `app.get_webview_window` in Rust or `WebviewWindow.getByLabel` in JavaScript\n\n When working with multiple windows, each window will need an unique label\n\n ```json\n {\n \"app\": {\n \"windows\": [\n { \"label\": \"main\", \"width\": 800, \"height\": 600 },\n { \"label\": \"secondary\", \"width\": 800, \"height\": 600 }\n ]\n }\n }\n ```\n\n You can also set `create` to false and use this config through the Rust APIs\n\n ```json\n {\n \"app\": {\n \"windows\": [\n { \"create\": false, \"width\": 800, \"height\": 600 }\n ]\n }\n }\n ```\n\n and use it like this\n\n ```rust\n tauri::Builder::default()\n .setup(|app| {\n tauri::WebviewWindowBuilder::from_config(app.handle(), app.config().app.windows[0])?.build()?;\n Ok(())\n });\n ```", + "description": "The app windows configuration.\n\n ## Example:\n\n To create a window at app startup\n\n ```json\n {\n \"app\": {\n \"windows\": [\n { \"width\": 800, \"height\": 600 }\n ]\n }\n }\n ```\n\n If not specified, the window's label (its identifier) defaults to \"main\",\n you can use this label to get the window through\n `app.get_webview_window` in Rust or `WebviewWindow.getByLabel` in JavaScript\n\n When working with multiple windows, each window will need an unique label\n\n ```json\n {\n \"app\": {\n \"windows\": [\n { \"label\": \"main\", \"width\": 800, \"height\": 600 },\n { \"label\": \"secondary\", \"width\": 800, \"height\": 600 }\n ]\n }\n }\n ```\n\n You can also set `create` to false and use this config through the Rust APIs\n\n ```json\n {\n \"app\": {\n \"windows\": [\n { \"create\": false, \"width\": 800, \"height\": 600 }\n ]\n }\n }\n ```\n\n and use it like this\n\n ```rust\n tauri::Builder::default()\n .setup(|app| {\n tauri::WebviewWindowBuilder::from_config(app.handle(), &app.config().app.windows[0])?.build()?;\n Ok(())\n });\n ```", "default": [], "type": "array", "items": { diff --git a/crates/tauri-utils/Cargo.toml b/crates/tauri-utils/Cargo.toml index 25debb2db..6ce1271a0 100644 --- a/crates/tauri-utils/Cargo.toml +++ b/crates/tauri-utils/Cargo.toml @@ -57,6 +57,7 @@ swift-rs = { version = "1", optional = true, features = ["build"] } [dev-dependencies] getrandom = { version = "0.3", features = ["std"] } serial_test = "3" +tauri = { path = "../tauri" } [features] build = [ diff --git a/crates/tauri-utils/src/config.rs b/crates/tauri-utils/src/config.rs index ada9041a6..4350398d0 100644 --- a/crates/tauri-utils/src/config.rs +++ b/crates/tauri-utils/src/config.rs @@ -2742,7 +2742,7 @@ pub struct AppConfig { /// ```rust /// tauri::Builder::default() /// .setup(|app| { - /// tauri::WebviewWindowBuilder::from_config(app.handle(), app.config().app.windows[0])?.build()?; + /// tauri::WebviewWindowBuilder::from_config(app.handle(), &app.config().app.windows[0])?.build()?; /// Ok(()) /// }); /// ``` diff --git a/crates/tests/acl/fixtures/snapshots/windows/acl_tests__tests__platform-specific-permissions.snap b/crates/tests/acl/fixtures/snapshots/windows/acl_tests__tests__platform-specific-permissions.snap index 17498f928..3c1197d81 100644 --- a/crates/tests/acl/fixtures/snapshots/windows/acl_tests__tests__platform-specific-permissions.snap +++ b/crates/tests/acl/fixtures/snapshots/windows/acl_tests__tests__platform-specific-permissions.snap @@ -3,6 +3,7 @@ source: crates/tests/acl/src/lib.rs expression: resolved --- Resolved { + has_app_acl: false, allowed_commands: { "plugin:os|spawn": [ ResolvedCommand { From b75ea5beadeb1b40582315e46d32f6bb0acc87a7 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 3 Jan 2026 12:34:59 +0800 Subject: [PATCH 32/57] chore(deps): update rust crate reqwest to 0.13 (#14724) * chore(deps): update rust crate reqwest to 0.13 * Fix feature name --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Tony --- Cargo.lock | 307 ++++++++++++++++++++++++++++++++-------- crates/tauri/Cargo.toml | 4 +- 2 files changed, 253 insertions(+), 58 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 929c91254..07477e279 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -300,7 +300,7 @@ dependencies = [ "ring", "rsa", "scroll", - "security-framework", + "security-framework 2.11.1", "security-framework-sys", "semver", "serde", @@ -553,6 +553,28 @@ dependencies = [ "arrayvec", ] +[[package]] +name = "aws-lc-rs" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a88aab2464f1f25453baa7a07c84c5b7684e274054ba06817f382357f77a288" +dependencies = [ + "aws-lc-sys", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45afffdee1e7c9126814751f88dddc747f41d91da16c9551a0f1e8a11e788a1" +dependencies = [ + "cc", + "cmake", + "dunce", + "fs_extra", +] + [[package]] name = "axum" version = "0.8.4" @@ -567,7 +589,7 @@ dependencies = [ "http 1.3.1", "http-body 1.0.1", "http-body-util", - "hyper 1.5.2", + "hyper 1.8.1", "hyper-util", "itoa", "matchit 0.8.4", @@ -1152,10 +1174,11 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.22" +version = "1.2.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" +checksum = "7a0aeaff4ff1a90589618835a598e545176939b97874f7abc7851caa0618f203" dependencies = [ + "find-msvc-tools", "jobserver", "libc", "shlex", @@ -1300,6 +1323,15 @@ dependencies = [ "digest", ] +[[package]] +name = "cmake" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75443c44cd6b379beb8c5b45d85d0773baf31cce901fe7bb252f4eff3008ef7d" +dependencies = [ + "cc", +] + [[package]] name = "color_quant" version = "1.1.0" @@ -2468,6 +2500,12 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "find-msvc-tools" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645cbb3a84e60b7531617d5ae4e57f7e27308f6445f5abf653209ea76dec8dff" + [[package]] name = "flate2" version = "1.1.1" @@ -2596,6 +2634,12 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + [[package]] name = "fsevent-sys" version = "4.1.0" @@ -3347,7 +3391,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.5.8", "tokio", "tower-service", "tracing", @@ -3356,13 +3400,14 @@ dependencies = [ [[package]] name = "hyper" -version = "1.5.2" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" +checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" dependencies = [ + "atomic-waker", "bytes", "futures-channel", - "futures-util", + "futures-core", "h2 0.4.7", "http 1.3.1", "http-body 1.0.1", @@ -3370,6 +3415,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", + "pin-utils", "smallvec", "tokio", "want", @@ -3397,14 +3443,13 @@ checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" dependencies = [ "futures-util", "http 1.3.1", - "hyper 1.5.2", + "hyper 1.8.1", "hyper-util", - "rustls 0.23.20", + "rustls 0.23.35", "rustls-pki-types", "tokio", "tokio-rustls 0.26.1", "tower-service", - "webpki-roots 0.26.7", ] [[package]] @@ -3415,7 +3460,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.5.2", + "hyper 1.8.1", "hyper-util", "native-tls", "tokio", @@ -3425,18 +3470,23 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.10" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +checksum = "727805d60e7938b76b826a6ef209eb70eaa1812794f9424d4a4e2d740662df5f" dependencies = [ + "base64 0.22.1", "bytes", "futures-channel", + "futures-core", "futures-util", "http 1.3.1", "http-body 1.0.1", - "hyper 1.5.2", + "hyper 1.8.1", + "ipnet", + "libc", + "percent-encoding", "pin-project-lite", - "socket2", + "socket2 0.6.1", "tokio", "tower-service", "tracing", @@ -3817,6 +3867,16 @@ version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" +[[package]] +name = "iri-string" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c91338f0783edbd6195decb37bae672fd3b165faffb89bf7b9e6942f8b1a731a" +dependencies = [ + "memchr", + "serde", +] + [[package]] name = "is-terminal" version = "0.4.13" @@ -4077,7 +4137,7 @@ dependencies = [ "http 1.3.1", "http-body 1.0.1", "http-body-util", - "hyper 1.5.2", + "hyper 1.8.1", "hyper-util", "jsonrpsee-core", "jsonrpsee-types", @@ -4289,9 +4349,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.169" +version = "0.2.178" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091" [[package]] name = "libfuzzer-sys" @@ -4720,10 +4780,10 @@ dependencies = [ "libc", "log", "openssl", - "openssl-probe", + "openssl-probe 0.1.5", "openssl-sys", "schannel", - "security-framework", + "security-framework 2.11.1", "security-framework-sys", "tempfile", ] @@ -5353,6 +5413,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-probe" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f50d9b3dabb09ecd771ad0aa242ca6894994c130308ca3d7684634df8037391" + [[package]] name = "openssl-src" version = "300.4.1+3.4.0" @@ -6367,8 +6433,8 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.23.20", - "socket2", + "rustls 0.23.35", + "socket2 0.5.8", "thiserror 2.0.12", "tokio", "tracing", @@ -6380,12 +6446,13 @@ version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" dependencies = [ + "aws-lc-rs", "bytes", "getrandom 0.2.15", "rand 0.8.5", "ring", "rustc-hash", - "rustls 0.23.20", + "rustls 0.23.35", "rustls-pki-types", "slab", "thiserror 2.0.12", @@ -6403,7 +6470,7 @@ dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2", + "socket2 0.5.8", "tracing", "windows-sys 0.59.0", ] @@ -6830,39 +6897,70 @@ dependencies = [ "http 1.3.1", "http-body 1.0.1", "http-body-util", - "hyper 1.5.2", - "hyper-rustls 0.27.5", - "hyper-tls", + "hyper 1.8.1", "hyper-util", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", - "quinn", - "rustls 0.23.20", - "rustls-pemfile 2.2.0", - "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", "sync_wrapper 1.0.2", "tokio", + "tower 0.5.2", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-registry 0.2.0", +] + +[[package]] +name = "reqwest" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04e9018c9d814e5f30cc16a0f03271aeab3571e609612d9fe78c1aa8d11c2f62" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-core", + "futures-util", + "http 1.3.1", + "http-body 1.0.1", + "http-body-util", + "hyper 1.8.1", + "hyper-rustls 0.27.5", + "hyper-tls", + "hyper-util", + "js-sys", + "log", + "native-tls", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls 0.23.35", + "rustls-pki-types", + "rustls-platform-verifier 0.6.2", + "serde", + "serde_json", + "sync_wrapper 1.0.2", + "tokio", "tokio-native-tls", "tokio-rustls 0.26.1", "tokio-util", "tower 0.5.2", + "tower-http", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 0.26.7", - "windows-registry 0.2.0", ] [[package]] @@ -7168,15 +7266,16 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.20" +version = "0.23.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" +checksum = "533f54bc6a7d4f647e46ad909549eda97bf5afc1585190ef692b4286b198bd8f" dependencies = [ + "aws-lc-rs", "log", "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.102.8", + "rustls-webpki 0.103.8", "subtle", "zeroize", ] @@ -7187,10 +7286,10 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ - "openssl-probe", + "openssl-probe 0.1.5", "rustls-pemfile 1.0.4", "schannel", - "security-framework", + "security-framework 2.11.1", ] [[package]] @@ -7199,11 +7298,23 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" dependencies = [ - "openssl-probe", + "openssl-probe 0.1.5", "rustls-pemfile 2.2.0", "rustls-pki-types", "schannel", - "security-framework", + "security-framework 2.11.1", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" +dependencies = [ + "openssl-probe 0.2.0", + "rustls-pki-types", + "schannel", + "security-framework 3.5.1", ] [[package]] @@ -7226,11 +7337,12 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.10.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" +checksum = "21e6f2ab2928ca4291b86736a8bd920a277a399bba1589409d72154ff87c1282" dependencies = [ "web-time", + "zeroize", ] [[package]] @@ -7244,16 +7356,37 @@ dependencies = [ "jni 0.19.0", "log", "once_cell", - "rustls 0.23.20", + "rustls 0.23.35", "rustls-native-certs 0.7.3", "rustls-platform-verifier-android", "rustls-webpki 0.102.8", - "security-framework", + "security-framework 2.11.1", "security-framework-sys", "webpki-roots 0.26.7", "winapi", ] +[[package]] +name = "rustls-platform-verifier" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d99feebc72bae7ab76ba994bb5e121b8d83d910ca40b36e0921f53becc41784" +dependencies = [ + "core-foundation 0.10.0", + "core-foundation-sys", + "jni 0.21.1", + "log", + "once_cell", + "rustls 0.23.35", + "rustls-native-certs 0.8.3", + "rustls-platform-verifier-android", + "rustls-webpki 0.103.8", + "security-framework 3.5.1", + "security-framework-sys", + "webpki-root-certs 1.0.5", + "windows-sys 0.60.2", +] + [[package]] name = "rustls-platform-verifier-android" version = "0.1.1" @@ -7281,6 +7414,18 @@ dependencies = [ "untrusted", ] +[[package]] +name = "rustls-webpki" +version = "0.103.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52" +dependencies = [ + "aws-lc-rs", + "ring", + "rustls-pki-types", + "untrusted", +] + [[package]] name = "rustversion" version = "1.0.19" @@ -7484,10 +7629,23 @@ dependencies = [ ] [[package]] -name = "security-framework-sys" -version = "2.14.0" +name = "security-framework" +version = "3.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef" +dependencies = [ + "bitflags 2.7.0", + "core-foundation 0.10.0", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" dependencies = [ "core-foundation-sys", "libc", @@ -8020,6 +8178,16 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "socket2" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] + [[package]] name = "socks" version = "0.3.4" @@ -8538,7 +8706,7 @@ dependencies = [ "quickcheck", "quickcheck_macros", "raw-window-handle", - "reqwest 0.12.12", + "reqwest 0.13.1", "serde", "serde_json", "serde_repr", @@ -8758,7 +8926,7 @@ dependencies = [ "futures", "futures-util", "http-body-util", - "hyper 1.5.2", + "hyper 1.8.1", "hyper-util", "pico-args", "serde", @@ -9226,7 +9394,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.8", "tokio-macros", "windows-sys 0.52.0", ] @@ -9268,7 +9436,7 @@ version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ - "rustls 0.23.20", + "rustls 0.23.35", "tokio", ] @@ -9451,6 +9619,24 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower-http" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" +dependencies = [ + "bitflags 2.7.0", + "bytes", + "futures-util", + "http 1.3.1", + "http-body 1.0.1", + "iri-string", + "pin-project-lite", + "tower 0.5.2", + "tower-layer", + "tower-service", +] + [[package]] name = "tower-layer" version = "0.3.3" @@ -9801,14 +9987,14 @@ dependencies = [ "log", "native-tls", "percent-encoding", - "rustls 0.23.20", + "rustls 0.23.35", "rustls-pemfile 2.2.0", "rustls-pki-types", - "rustls-platform-verifier", + "rustls-platform-verifier 0.3.4", "socks", "ureq-proto", "utf-8", - "webpki-root-certs", + "webpki-root-certs 0.26.7", "webpki-roots 0.26.7", ] @@ -10217,6 +10403,15 @@ dependencies = [ "rustls-pki-types", ] +[[package]] +name = "webpki-root-certs" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36a29fc0408b113f68cf32637857ab740edfafdf460c326cd2afaa2d84cc05dc" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "webpki-roots" version = "0.25.4" diff --git a/crates/tauri/Cargo.toml b/crates/tauri/Cargo.toml index 4da7736cd..b7cee807a 100644 --- a/crates/tauri/Cargo.toml +++ b/crates/tauri/Cargo.toml @@ -141,7 +141,7 @@ windows = { version = "0.61", features = [ # mobile [target.'cfg(any(target_os = "android", all(target_vendor = "apple", not(target_os = "macos"))))'.dependencies] bytes = { version = "1", features = ["serde"] } -reqwest = { version = "0.12", default-features = false, features = [ +reqwest = { version = "0.13", default-features = false, features = [ "json", "stream", @@ -201,7 +201,7 @@ custom-protocol = ["tauri-macros/custom-protocol"] # For now those feature flags keep enabling reqwest features in case some users depend on that by accident. native-tls = ["reqwest/native-tls"] native-tls-vendored = ["reqwest/native-tls-vendored"] -rustls-tls = ["reqwest/rustls-tls"] +rustls-tls = ["reqwest/rustls"] devtools = ["tauri-runtime/devtools", "tauri-runtime-wry?/devtools"] process-relaunch-dangerous-allow-symlink-macos = [ "tauri-utils/process-relaunch-dangerous-allow-symlink-macos", From a03219ca196372fca542633900a5ad26d805fcf7 Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Sat, 3 Jan 2026 19:30:42 +0800 Subject: [PATCH 33/57] refactor(cli): disable jsonschema resolving external resources (#14725) * refactor(cli): disable jsonschema resolving external resources * Move `CONFIG_SCHEMA_VALIDATOR` to fn * Format * Update ureq to fix compile on linux * New clippy warnings --- Cargo.lock | 178 +++++-------------------- crates/tauri-cli/Cargo.toml | 2 +- crates/tauri-cli/src/helpers/config.rs | 21 ++- crates/tauri-cli/src/interface/rust.rs | 2 +- 4 files changed, 48 insertions(+), 155 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 07477e279..cf21f5252 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2365,11 +2365,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "erased-serde" -version = "0.4.5" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d" +checksum = "89e8918065695684b2b0702da20382d5ae6065cf3327bc2d6436bd49a71ce9f3" dependencies = [ "serde", + "serde_core", "typeid", ] @@ -3976,20 +3977,6 @@ dependencies = [ "system-deps", ] -[[package]] -name = "jni" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" -dependencies = [ - "cesu8", - "combine", - "jni-sys", - "log", - "thiserror 1.0.69", - "walkdir", -] - [[package]] name = "jni" version = "0.21.1" @@ -4200,7 +4187,6 @@ dependencies = [ "referencing", "regex", "regex-syntax", - "reqwest 0.12.12", "serde", "serde_json", "uuid-simd", @@ -4488,9 +4474,9 @@ checksum = "9374ef4228402d4b7e403e5838cb880d9ee663314b0a900d5a6aabf0c213552e" [[package]] name = "log" -version = "0.4.22" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" dependencies = [ "value-bag", ] @@ -6883,43 +6869,6 @@ dependencies = [ "winreg 0.50.0", ] -[[package]] -name = "reqwest" -version = "0.12.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" -dependencies = [ - "base64 0.22.1", - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "http 1.3.1", - "http-body 1.0.1", - "http-body-util", - "hyper 1.8.1", - "hyper-util", - "ipnet", - "js-sys", - "log", - "mime", - "once_cell", - "percent-encoding", - "pin-project-lite", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper 1.0.2", - "tokio", - "tower 0.5.2", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "windows-registry 0.2.0", -] - [[package]] name = "reqwest" version = "0.13.1" @@ -6945,7 +6894,7 @@ dependencies = [ "quinn", "rustls 0.23.35", "rustls-pki-types", - "rustls-platform-verifier 0.6.2", + "rustls-platform-verifier", "serde", "serde_json", "sync_wrapper 1.0.2", @@ -7345,27 +7294,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rustls-platform-verifier" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afbb878bdfdf63a336a5e63561b1835e7a8c91524f51621db870169eac84b490" -dependencies = [ - "core-foundation 0.9.4", - "core-foundation-sys", - "jni 0.19.0", - "log", - "once_cell", - "rustls 0.23.35", - "rustls-native-certs 0.7.3", - "rustls-platform-verifier-android", - "rustls-webpki 0.102.8", - "security-framework 2.11.1", - "security-framework-sys", - "webpki-roots 0.26.7", - "winapi", -] - [[package]] name = "rustls-platform-verifier" version = "0.6.2" @@ -7374,7 +7302,7 @@ checksum = "1d99feebc72bae7ab76ba994bb5e121b8d83d910ca40b36e0921f53becc41784" dependencies = [ "core-foundation 0.10.0", "core-foundation-sys", - "jni 0.21.1", + "jni", "log", "once_cell", "rustls 0.23.35", @@ -7383,7 +7311,7 @@ dependencies = [ "rustls-webpki 0.103.8", "security-framework 3.5.1", "security-framework-sys", - "webpki-root-certs 1.0.5", + "webpki-root-certs", "windows-sys 0.60.2", ] @@ -7624,7 +7552,6 @@ dependencies = [ "core-foundation 0.9.4", "core-foundation-sys", "libc", - "num-bigint", "security-framework-sys", ] @@ -8614,7 +8541,7 @@ dependencies = [ "gdkwayland-sys", "gdkx11-sys", "gtk", - "jni 0.21.1", + "jni", "lazy_static", "libc", "log", @@ -8690,7 +8617,7 @@ dependencies = [ "http 1.3.1", "http-range", "image", - "jni 0.21.1", + "jni", "libc", "log", "mime", @@ -8794,7 +8721,7 @@ dependencies = [ "uuid", "walkdir", "which", - "windows-registry 0.5.0", + "windows-registry", "windows-sys 0.60.2", "zip 4.0.0", ] @@ -9047,7 +8974,7 @@ dependencies = [ "dpi", "gtk", "http 1.3.1", - "jni 0.21.1", + "jni", "objc2 0.6.0", "objc2-ui-kit", "objc2-web-kit", @@ -9068,7 +8995,7 @@ version = "2.9.3" dependencies = [ "gtk", "http 1.3.1", - "jni 0.21.1", + "jni", "log", "objc2 0.6.0", "objc2-app-kit", @@ -9976,33 +9903,31 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "3.0.3" +version = "3.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "217751151c53226090391713e533d9a5e904ba2570dabaaace29032687589c3e" +checksum = "d39cb1dbab692d82a977c0392ffac19e188bd9186a9f32806f0aaa859d75585a" dependencies = [ "base64 0.22.1", - "cc", "der", "flate2", "log", "native-tls", "percent-encoding", "rustls 0.23.35", - "rustls-pemfile 2.2.0", "rustls-pki-types", - "rustls-platform-verifier 0.3.4", + "rustls-platform-verifier", "socks", "ureq-proto", "utf-8", - "webpki-root-certs 0.26.7", - "webpki-roots 0.26.7", + "webpki-root-certs", + "webpki-roots 1.0.5", ] [[package]] name = "ureq-proto" -version = "0.3.0" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c51fe73e1d8c4e06bb2698286f7e7453c6fc90528d6d2e7fc36bb4e87fe09b1" +checksum = "d81f9efa9df032be5934a46a068815a10a042b494b6a58cb0a1a97bb5467ed6f" dependencies = [ "base64 0.22.1", "http 1.3.1", @@ -10126,9 +10051,9 @@ dependencies = [ [[package]] name = "value-bag" -version = "1.10.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ef4c4aa54d5d05a279399bfa921ec387b7aba77caf7a682ae8d86785b8fdad2" +checksum = "7ba6f5989077681266825251a52748b8c1d8a4ad098cc37e440103d0ea717fc0" dependencies = [ "value-bag-serde1", "value-bag-sval2", @@ -10136,20 +10061,20 @@ dependencies = [ [[package]] name = "value-bag-serde1" -version = "1.10.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb773bd36fd59c7ca6e336c94454d9c66386416734817927ac93d81cb3c5b0b" +checksum = "16530907bfe2999a1773ca5900a65101e092c70f642f25cc23ca0c43573262c5" dependencies = [ "erased-serde", - "serde", + "serde_core", "serde_fmt", ] [[package]] name = "value-bag-sval2" -version = "1.10.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53a916a702cac43a88694c97657d449775667bcd14b70419441d05b7fea4a83a" +checksum = "d00ae130edd690eaa877e4f40605d534790d1cf1d651e7685bd6a144521b251f" dependencies = [ "sval", "sval_buffer", @@ -10394,15 +10319,6 @@ dependencies = [ "system-deps", ] -[[package]] -name = "webpki-root-certs" -version = "0.26.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cd5da49bdf1f30054cfe0b8ce2958b8fbeb67c4d82c8967a598af481bef255c" -dependencies = [ - "rustls-pki-types", -] - [[package]] name = "webpki-root-certs" version = "1.0.5" @@ -10420,9 +10336,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.26.7" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" +checksum = "12bed680863276c63889429bfd6cab3b99943659923822de1c8a39c49e4d722c" dependencies = [ "rustls-pki-types", ] @@ -10592,7 +10508,7 @@ dependencies = [ "windows-implement", "windows-interface", "windows-link", - "windows-result 0.3.2", + "windows-result", "windows-strings 0.4.0", ] @@ -10644,17 +10560,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "windows-registry" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" -dependencies = [ - "windows-result 0.2.0", - "windows-strings 0.1.0", - "windows-targets 0.52.6", -] - [[package]] name = "windows-registry" version = "0.5.0" @@ -10662,19 +10567,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c44a98275e31bfd112bb06ba96c8ab13c03383a3753fdddd715406a1824c7e0" dependencies = [ "windows-link", - "windows-result 0.3.2", + "windows-result", "windows-strings 0.3.1", ] -[[package]] -name = "windows-result" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-result" version = "0.3.2" @@ -10684,16 +10580,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "windows-strings" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" -dependencies = [ - "windows-result 0.2.0", - "windows-targets 0.52.6", -] - [[package]] name = "windows-strings" version = "0.3.1" @@ -11150,7 +11036,7 @@ dependencies = [ "html5ever", "http 1.3.1", "javascriptcore-rs", - "jni 0.21.1", + "jni", "kuchikiki", "libc", "ndk", diff --git a/crates/tauri-cli/Cargo.toml b/crates/tauri-cli/Cargo.toml index 5aa656ff7..131b654a7 100644 --- a/crates/tauri-cli/Cargo.toml +++ b/crates/tauri-cli/Cargo.toml @@ -66,7 +66,7 @@ tauri-utils = { version = "2.8.1", path = "../tauri-utils", features = [ "html-manipulation", ] } toml = "0.9" -jsonschema = "0.33" +jsonschema = { version = "0.33", default-features = false } handlebars = "6" include_dir = "0.7" dirs = "6" diff --git a/crates/tauri-cli/src/helpers/config.rs b/crates/tauri-cli/src/helpers/config.rs index d25c29d4f..eb2a643de 100644 --- a/crates/tauri-cli/src/helpers/config.rs +++ b/crates/tauri-cli/src/helpers/config.rs @@ -14,7 +14,7 @@ use std::{ env::{current_dir, set_current_dir, set_var}, ffi::{OsStr, OsString}, process::exit, - sync::Mutex, + sync::{Mutex, OnceLock}, }; use crate::error::Context; @@ -146,6 +146,16 @@ fn config_handle() -> ConfigHandle { &CONFIG_HANDLE } +fn config_schema_validator() -> &'static jsonschema::Validator { + // TODO: Switch to `LazyLock` when we bump MSRV to above 1.80 + static CONFIG_SCHEMA_VALIDATOR: OnceLock = OnceLock::new(); + CONFIG_SCHEMA_VALIDATOR.get_or_init(|| { + let schema: JsonValue = serde_json::from_str(include_str!("../../config.schema.json")) + .expect("Failed to parse config schema bundled in the tauri-cli"); + jsonschema::validator_for(&schema).expect("Config schema bundled in the tauri-cli is invalid") + }) +} + /// Gets the static parsed config from `tauri.conf.json`. fn get_internal( merge_configs: &[&serde_json::Value], @@ -192,17 +202,14 @@ fn get_internal( if config_path.extension() == Some(OsStr::new("json")) || config_path.extension() == Some(OsStr::new("json5")) { - let schema: JsonValue = serde_json::from_str(include_str!("../../config.schema.json")) - .context("failed to parse config schema")?; - let validator = jsonschema::validator_for(&schema).expect("Invalid schema"); - let mut errors = validator.iter_errors(&config).peekable(); + let mut errors = config_schema_validator().iter_errors(&config).peekable(); if errors.peek().is_some() { for error in errors { let path = error.instance_path.into_iter().join(" > "); if path.is_empty() { - log::error!("`{config_file_name:?}` error: {}", error); + log::error!("`{config_file_name:?}` error: {error}"); } else { - log::error!("`{config_file_name:?}` error on `{}`: {}", path, error); + log::error!("`{config_file_name:?}` error on `{path}`: {error}"); } } if !reload { diff --git a/crates/tauri-cli/src/interface/rust.rs b/crates/tauri-cli/src/interface/rust.rs index 801e18767..6f303c732 100644 --- a/crates/tauri-cli/src/interface/rust.rs +++ b/crates/tauri-cli/src/interface/rust.rs @@ -485,7 +485,7 @@ fn get_watch_folders(additional_watch_folders: &[PathBuf]) -> crate::Result { // If this fails cargo itself should fail too. But we still try to keep going with the unexpanded path. - log::error!("Error watching {}: {}", p.display(), err.to_string()); + log::error!("Error watching {}: {}", p.display(), err); watch_folders.push(p); } }; From fea4d0240341c6526105fa713ca97b00563aecd7 Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Tue, 6 Jan 2026 11:16:00 +0100 Subject: [PATCH 34/57] chore(deps): update rkyv, closes #14734 (#14736) --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cf21f5252..86f90143f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6991,9 +6991,9 @@ dependencies = [ [[package]] name = "rkyv" -version = "0.7.45" +version = "0.7.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9008cd6385b9e161d8229e1f6549dd23c3d022f132a2ea37ac3a10ac4935779b" +checksum = "2297bf9c81a3f0dc96bc9521370b88f054168c29826a75e89c55ff196e7ed6a1" dependencies = [ "bitvec", "bytecheck", @@ -7009,9 +7009,9 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.7.45" +version = "0.7.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "503d1d27590a2b0a3a4ca4c94755aa2875657196ecbf401a42eff41d7de532c0" +checksum = "84d7b42d4b8d06048d3ac8db0eb31bcb942cbeb709f0b5f2b2ebde398d3038f5" dependencies = [ "proc-macro2", "quote", From 3d102e0c136955f20e699835ddfcd004bc0ce799 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Jan 2026 19:26:47 +0100 Subject: [PATCH 35/57] chore(deps): bump rsa from 0.9.7 to 0.9.10 (#14738) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 86f90143f..d5b88b912 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7073,9 +7073,9 @@ dependencies = [ [[package]] name = "rsa" -version = "0.9.7" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47c75d7c5c6b673e58bf54d8544a9f432e3a925b0e80f7cd3602ab5c50c55519" +checksum = "b8573f03f5883dcaebdfcf4725caa1ecb9c15b2ef50c43a07b816e06799bb12d" dependencies = [ "const-oid", "digest", From 897529d7a28049c9142a0f060ecd90e2e0ca8921 Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Thu, 8 Jan 2026 22:14:51 +0800 Subject: [PATCH 36/57] fix: map `rustls-tls` to `reqwest/rustls-no-provider` (#14726) Co-authored-by: FabianLars --- Cargo.lock | 107 +---------------------------- crates/tauri/Cargo.toml | 7 +- crates/tauri/src/protocol/tauri.rs | 12 ++-- 3 files changed, 13 insertions(+), 113 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d5b88b912..777ea58a4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -553,28 +553,6 @@ dependencies = [ "arrayvec", ] -[[package]] -name = "aws-lc-rs" -version = "1.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a88aab2464f1f25453baa7a07c84c5b7684e274054ba06817f382357f77a288" -dependencies = [ - "aws-lc-sys", - "zeroize", -] - -[[package]] -name = "aws-lc-sys" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45afffdee1e7c9126814751f88dddc747f41d91da16c9551a0f1e8a11e788a1" -dependencies = [ - "cc", - "cmake", - "dunce", - "fs_extra", -] - [[package]] name = "axum" version = "0.8.4" @@ -1323,15 +1301,6 @@ dependencies = [ "digest", ] -[[package]] -name = "cmake" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75443c44cd6b379beb8c5b45d85d0773baf31cce901fe7bb252f4eff3008ef7d" -dependencies = [ - "cc", -] - [[package]] name = "color_quant" version = "1.1.0" @@ -2635,12 +2604,6 @@ dependencies = [ "thiserror 1.0.69", ] -[[package]] -name = "fs_extra" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" - [[package]] name = "fsevent-sys" version = "4.1.0" @@ -2898,10 +2861,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", - "wasm-bindgen", ] [[package]] @@ -6408,59 +6369,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "quinn" -version = "0.11.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" -dependencies = [ - "bytes", - "pin-project-lite", - "quinn-proto", - "quinn-udp", - "rustc-hash", - "rustls 0.23.35", - "socket2 0.5.8", - "thiserror 2.0.12", - "tokio", - "tracing", -] - -[[package]] -name = "quinn-proto" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" -dependencies = [ - "aws-lc-rs", - "bytes", - "getrandom 0.2.15", - "rand 0.8.5", - "ring", - "rustc-hash", - "rustls 0.23.35", - "rustls-pki-types", - "slab", - "thiserror 2.0.12", - "tinyvec", - "tracing", - "web-time", -] - -[[package]] -name = "quinn-udp" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c40286217b4ba3a71d644d752e6a0b71f13f1b6a2c5311acfcbe0c2418ed904" -dependencies = [ - "cfg_aliases", - "libc", - "once_cell", - "socket2 0.5.8", - "tracing", - "windows-sys 0.59.0", -] - [[package]] name = "quote" version = "1.0.38" @@ -6891,7 +6799,6 @@ dependencies = [ "native-tls", "percent-encoding", "pin-project-lite", - "quinn", "rustls 0.23.35", "rustls-pki-types", "rustls-platform-verifier", @@ -7219,7 +7126,6 @@ version = "0.23.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "533f54bc6a7d4f647e46ad909549eda97bf5afc1585190ef692b4286b198bd8f" dependencies = [ - "aws-lc-rs", "log", "once_cell", "ring", @@ -7290,7 +7196,6 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21e6f2ab2928ca4291b86736a8bd920a277a399bba1589409d72154ff87c1282" dependencies = [ - "web-time", "zeroize", ] @@ -7348,7 +7253,6 @@ version = "0.103.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52" dependencies = [ - "aws-lc-rs", "ring", "rustls-pki-types", "untrusted", @@ -8634,6 +8538,7 @@ dependencies = [ "quickcheck_macros", "raw-window-handle", "reqwest 0.13.1", + "rustls 0.23.35", "serde", "serde_json", "serde_repr", @@ -10265,16 +10170,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "web-time" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - [[package]] name = "webkit2gtk" version = "2.0.1" diff --git a/crates/tauri/Cargo.toml b/crates/tauri/Cargo.toml index b7cee807a..72fb921b9 100644 --- a/crates/tauri/Cargo.toml +++ b/crates/tauri/Cargo.toml @@ -144,8 +144,10 @@ bytes = { version = "1", features = ["serde"] } reqwest = { version = "0.13", default-features = false, features = [ "json", "stream", - ] } +rustls = { version = "0.23", default-features = false, features = [ + "ring", +], optional = true } # android [target.'cfg(target_os = "android")'.dependencies] @@ -198,10 +200,9 @@ linux-libxdo = ["tray-icon/libxdo", "muda/libxdo"] isolation = ["tauri-utils/isolation", "tauri-macros/isolation", "uuid"] custom-protocol = ["tauri-macros/custom-protocol"] # TODO: Remove these flags in v3 and/or enable them by default behind a mobile flag https://github.com/tauri-apps/tauri/issues/12384 -# For now those feature flags keep enabling reqwest features in case some users depend on that by accident. native-tls = ["reqwest/native-tls"] native-tls-vendored = ["reqwest/native-tls-vendored"] -rustls-tls = ["reqwest/rustls"] +rustls-tls = ["reqwest/rustls-no-provider", "dep:rustls"] devtools = ["tauri-runtime/devtools", "tauri-runtime-wry?/devtools"] process-relaunch-dangerous-allow-symlink-macos = [ "tauri-utils/process-relaunch-dangerous-allow-symlink-macos", diff --git a/crates/tauri/src/protocol/tauri.rs b/crates/tauri/src/protocol/tauri.rs index 10cab2ced..a346754f0 100644 --- a/crates/tauri/src/protocol/tauri.rs +++ b/crates/tauri/src/protocol/tauri.rs @@ -114,6 +114,11 @@ fn get_response( decoded_path.trim_start_matches('/') ); + #[cfg(feature = "rustls-tls")] + if rustls::crypto::CryptoProvider::get_default().is_none() { + let _ = rustls::crypto::ring::default_provider().install_default(); + } + let mut client = reqwest::ClientBuilder::new(); if url.starts_with("https://") { @@ -126,10 +131,9 @@ fn get_response( ))] { log::info!("adding dev server root certificate"); - client = client.add_root_certificate( - reqwest::Certificate::from_pem(cert_pem.as_bytes()) - .expect("failed to parse TAURI_DEV_ROOT_CERTIFICATE"), - ); + let certificate = reqwest::Certificate::from_pem(cert_pem.as_bytes()) + .expect("failed to parse TAURI_DEV_ROOT_CERTIFICATE"); + client = client.tls_certs_merge([certificate]); } #[cfg(not(any( From 84b04c4a8d3310b7a7091d10e36244bf94996e51 Mon Sep 17 00:00:00 2001 From: Amr Bashir Date: Sun, 11 Jan 2026 20:37:52 +0200 Subject: [PATCH 37/57] fix: fix leftover inconsistent env var in `tauri signer sign` command (#14759) --- .changes/signing-env-vars.md | 14 +++++++++ crates/tauri-cli/src/signer/generate.rs | 37 ++++++++++++----------- crates/tauri-cli/src/signer/sign.rs | 39 +++++++++++++++++++++++-- 3 files changed, 70 insertions(+), 20 deletions(-) create mode 100644 .changes/signing-env-vars.md diff --git a/.changes/signing-env-vars.md b/.changes/signing-env-vars.md new file mode 100644 index 000000000..c164c3b9a --- /dev/null +++ b/.changes/signing-env-vars.md @@ -0,0 +1,14 @@ +--- +"tauri-cli": patch:enhance +"@tauri-apps/cli": patch:enhance +--- + +Added new environment variables for `tauri signer sign` command, to align with existing environment variables used in `tauri build`, `tauri bundle` and `tauri signer generate` +- `TAURI_SIGNING_PRIVATE_KEY` +- `TAURI_SIGNING_PRIVATE_KEY_PATH` +- `TAURI_SIGNING_PRIVATE_KEY_PASSWORD` + +The old environment variables are deprecated and will be removed in a future release. +- `TAURI_PRIVATE_KEY` +- `TAURI_PRIVATE_KEY_PATH` +- `TAURI_PRIVATE_KEY_PASSWORD` diff --git a/crates/tauri-cli/src/signer/generate.rs b/crates/tauri-cli/src/signer/generate.rs index 97f3b3708..6ca4244c7 100644 --- a/crates/tauri-cli/src/signer/generate.rs +++ b/crates/tauri-cli/src/signer/generate.rs @@ -39,26 +39,29 @@ pub fn command(mut options: Options) -> Result<()> { save_keypair(options.force, output_path, &keypair.sk, &keypair.pk) .expect("Unable to write keypair"); - println!( - "\nYour keypair was generated successfully\nPrivate: {} (Keep it secret!)\nPublic: {}\n---------------------------", - display_path(secret_path), - display_path(public_path) - ) + println!(); + println!("Your keypair was generated successfully:"); + println!("Private: {} (Keep it secret!)", display_path(secret_path)); + println!("Public: {}", display_path(public_path)); + println!("---------------------------") } else { - println!( - "\nYour secret key was generated successfully - Keep it secret!\n{}\n\n", - keypair.sk - ); - println!( - "Your public key was generated successfully:\n{}\n\nAdd the public key in your tauri.conf.json\n---------------------------\n", - keypair.pk - ); + println!(); + println!("Your keys were generated successfully!",); + println!(); + println!("Private: (Keep it secret!)"); + println!("{}", keypair.sk); + println!(); + println!("Public:"); + println!("{}", keypair.pk); } - println!("\nEnvironment variables used to sign:"); - println!("`TAURI_SIGNING_PRIVATE_KEY` Path or String of your private key"); - println!("`TAURI_SIGNING_PRIVATE_KEY_PASSWORD` Your private key password (optional)"); - println!("\nATTENTION: If you lose your private key OR password, you'll not be able to sign your update package and updates will not work.\n---------------------------\n"); + println!(); + println!("Environment variables used to sign:"); + println!("- `TAURI_SIGNING_PRIVATE_KEY`: String of your private key"); + println!("- `TAURI_SIGNING_PRIVATE_KEY_PATH`: Path to your private key file"); + println!("- `TAURI_SIGNING_PRIVATE_KEY_PASSWORD`: Your private key password (optional if key has no password)"); + println!(); + println!("ATTENTION: If you lose your private key OR password, you'll not be able to sign your update package and updates will not work"); Ok(()) } diff --git a/crates/tauri-cli/src/signer/sign.rs b/crates/tauri-cli/src/signer/sign.rs index 44eee5d57..a50e4e083 100644 --- a/crates/tauri-cli/src/signer/sign.rs +++ b/crates/tauri-cli/src/signer/sign.rs @@ -21,7 +21,7 @@ pub struct Options { short = 'k', long, conflicts_with("private_key_path"), - env = "TAURI_PRIVATE_KEY" + env = "TAURI_SIGNING_PRIVATE_KEY" )] private_key: Option, /// Load the private key from a file @@ -29,17 +29,50 @@ pub struct Options { short = 'f', long, conflicts_with("private_key"), - env = "TAURI_PRIVATE_KEY_PATH" + env = "TAURI_SIGNING_PRIVATE_KEY_PATH" )] private_key_path: Option, /// Set private key password when signing - #[clap(short, long, env = "TAURI_PRIVATE_KEY_PASSWORD")] + #[clap(short, long, env = "TAURI_SIGNING_PRIVATE_KEY_PASSWORD")] password: Option, /// Sign the specified file file: PathBuf, } +// Backwards compatibility with old env vars +// TODO: remove in v3.0 +fn backward_env_vars(mut options: Options) -> Options { + let get_env = |old, new| { + if let Ok(old_value) = std::env::var(old) { + println!( + "\x1b[33mWarning: The environment variable '{old}' is deprecated. Please use '{new}' instead.\x1b[0m", + ); + Some(old_value) + } else { + None + } + }; + + options.private_key = options + .private_key + .or_else(|| get_env("TAURI_PRIVATE_KEY", "TAURI_SIGNING_PRIVATE_KEY")); + + options.private_key_path = options.private_key_path.or_else(|| { + get_env("TAURI_PRIVATE_KEY_PATH", "TAURI_SIGNING_PRIVATE_KEY_PATH").map(PathBuf::from) + }); + + options.password = options.password.or_else(|| { + get_env( + "TAURI_PRIVATE_KEY_PASSWORD", + "TAURI_SIGNING_PRIVATE_KEY_PASSWORD", + ) + }); + options +} + pub fn command(mut options: Options) -> Result<()> { + options = backward_env_vars(options); + options.private_key = if let Some(private_key) = options.private_key_path { Some(std::fs::read_to_string(Path::new(&private_key)).expect("Unable to extract private key")) } else { From 1b0e335d3f3445948d6590f7e074275d97cd9859 Mon Sep 17 00:00:00 2001 From: Wuelfhis Asuaje Date: Tue, 13 Jan 2026 22:09:45 -0300 Subject: [PATCH 38/57] Fix: Updater signer failed signing file without extension (#14713) * fixing bug where updater signer failed signing file withou extension * removing unnecessary unwrap() * Adding change file. Removing commnent. Adding TODO. * Apply suggestions from code review --------- Co-authored-by: Wuelfhis Asuaje Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com> --- .changes/updater-signer-files-without-extension.md | 6 ++++++ crates/tauri-cli/src/helpers/updater_signature.rs | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 .changes/updater-signer-files-without-extension.md diff --git a/.changes/updater-signer-files-without-extension.md b/.changes/updater-signer-files-without-extension.md new file mode 100644 index 000000000..1ff41edbd --- /dev/null +++ b/.changes/updater-signer-files-without-extension.md @@ -0,0 +1,6 @@ +--- +tauri-cli: patch:bug +"@tauri-apps/cli": patch:bug +--- + +`tauri signer sign` doesn't work for files without an extension diff --git a/crates/tauri-cli/src/helpers/updater_signature.rs b/crates/tauri-cli/src/helpers/updater_signature.rs index 9367e7bad..ba9012359 100644 --- a/crates/tauri-cli/src/helpers/updater_signature.rs +++ b/crates/tauri-cli/src/helpers/updater_signature.rs @@ -120,9 +120,14 @@ where { let bin_path = bin_path.as_ref(); // We need to append .sig at the end it's where the signature will be stored - let mut extension = bin_path.extension().unwrap().to_os_string(); - extension.push(".sig"); - let signature_path = bin_path.with_extension(extension); + // TODO: use with_added_extension when we bump MSRV to > 1.91' + let signature_path = if let Some(ext) = bin_path.extension() { + let mut extension = ext.to_os_string(); + extension.push(".sig"); + bin_path.with_extension(extension) + } else { + bin_path.with_extension("sig") + }; let trusted_comment = format!( "timestamp:{}\tfile:{}", From 137576e8a481896af24cbf076aca4b5e8545d879 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 15 Jan 2026 11:51:21 +0100 Subject: [PATCH 39/57] chore(deps): update dependency rollup to v4.55.1 (#14746) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- packages/api/package.json | 2 +- pnpm-lock.yaml | 233 +++++++++++++++++++++----------------- 2 files changed, 131 insertions(+), 104 deletions(-) diff --git a/packages/api/package.json b/packages/api/package.json index 35b0db2b0..b514d120f 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -55,7 +55,7 @@ "eslint-plugin-security": "3.0.1", "fast-glob": "3.3.3", "globals": "^16.2.0", - "rollup": "4.54.0", + "rollup": "4.55.1", "tslib": "^2.8.1", "typescript": "^5.8.3", "typescript-eslint": "^8.34.1" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 55b351c20..00adfe120 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -63,10 +63,10 @@ importers: version: 9.29.0 '@rollup/plugin-terser': specifier: 0.4.4 - version: 0.4.4(rollup@4.54.0) + version: 0.4.4(rollup@4.55.1) '@rollup/plugin-typescript': specifier: 12.3.0 - version: 12.3.0(rollup@4.54.0)(tslib@2.8.1)(typescript@5.8.3) + version: 12.3.0(rollup@4.55.1)(tslib@2.8.1)(typescript@5.8.3) '@types/eslint': specifier: ^9.6.1 version: 9.6.1 @@ -89,8 +89,8 @@ importers: specifier: ^16.2.0 version: 16.2.0 rollup: - specifier: 4.54.0 - version: 4.54.0 + specifier: 4.55.1 + version: 4.55.1 tslib: specifier: ^2.8.1 version: 2.8.1 @@ -1125,113 +1125,128 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.54.0': - resolution: {integrity: sha512-OywsdRHrFvCdvsewAInDKCNyR3laPA2mc9bRYJ6LBp5IyvF3fvXbbNR0bSzHlZVFtn6E0xw2oZlyjg4rKCVcng==} + '@rollup/rollup-android-arm-eabi@4.55.1': + resolution: {integrity: sha512-9R0DM/ykwfGIlNu6+2U09ga0WXeZ9MRC2Ter8jnz8415VbuIykVuc6bhdrbORFZANDmTDvq26mJrEVTl8TdnDg==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.54.0': - resolution: {integrity: sha512-Skx39Uv+u7H224Af+bDgNinitlmHyQX1K/atIA32JP3JQw6hVODX5tkbi2zof/E69M1qH2UoN3Xdxgs90mmNYw==} + '@rollup/rollup-android-arm64@4.55.1': + resolution: {integrity: sha512-eFZCb1YUqhTysgW3sj/55du5cG57S7UTNtdMjCW7LwVcj3dTTcowCsC8p7uBdzKsZYa8J7IDE8lhMI+HX1vQvg==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.54.0': - resolution: {integrity: sha512-k43D4qta/+6Fq+nCDhhv9yP2HdeKeP56QrUUTW7E6PhZP1US6NDqpJj4MY0jBHlJivVJD5P8NxrjuobZBJTCRw==} + '@rollup/rollup-darwin-arm64@4.55.1': + resolution: {integrity: sha512-p3grE2PHcQm2e8PSGZdzIhCKbMCw/xi9XvMPErPhwO17vxtvCN5FEA2mSLgmKlCjHGMQTP6phuQTYWUnKewwGg==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.54.0': - resolution: {integrity: sha512-cOo7biqwkpawslEfox5Vs8/qj83M/aZCSSNIWpVzfU2CYHa2G3P1UN5WF01RdTHSgCkri7XOlTdtk17BezlV3A==} + '@rollup/rollup-darwin-x64@4.55.1': + resolution: {integrity: sha512-rDUjG25C9qoTm+e02Esi+aqTKSBYwVTaoS1wxcN47/Luqef57Vgp96xNANwt5npq9GDxsH7kXxNkJVEsWEOEaQ==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.54.0': - resolution: {integrity: sha512-miSvuFkmvFbgJ1BevMa4CPCFt5MPGw094knM64W9I0giUIMMmRYcGW/JWZDriaw/k1kOBtsWh1z6nIFV1vPNtA==} + '@rollup/rollup-freebsd-arm64@4.55.1': + resolution: {integrity: sha512-+JiU7Jbp5cdxekIgdte0jfcu5oqw4GCKr6i3PJTlXTCU5H5Fvtkpbs4XJHRmWNXF+hKmn4v7ogI5OQPaupJgOg==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.54.0': - resolution: {integrity: sha512-KGXIs55+b/ZfZsq9aR026tmr/+7tq6VG6MsnrvF4H8VhwflTIuYh+LFUlIsRdQSgrgmtM3fVATzEAj4hBQlaqQ==} + '@rollup/rollup-freebsd-x64@4.55.1': + resolution: {integrity: sha512-V5xC1tOVWtLLmr3YUk2f6EJK4qksksOYiz/TCsFHu/R+woubcLWdC9nZQmwjOAbmExBIVKsm1/wKmEy4z4u4Bw==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.54.0': - resolution: {integrity: sha512-EHMUcDwhtdRGlXZsGSIuXSYwD5kOT9NVnx9sqzYiwAc91wfYOE1g1djOEDseZJKKqtHAHGwnGPQu3kytmfaXLQ==} + '@rollup/rollup-linux-arm-gnueabihf@4.55.1': + resolution: {integrity: sha512-Rn3n+FUk2J5VWx+ywrG/HGPTD9jXNbicRtTM11e/uorplArnXZYsVifnPPqNNP5BsO3roI4n8332ukpY/zN7rQ==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.54.0': - resolution: {integrity: sha512-+pBrqEjaakN2ySv5RVrj/qLytYhPKEUwk+e3SFU5jTLHIcAtqh2rLrd/OkbNuHJpsBgxsD8ccJt5ga/SeG0JmA==} + '@rollup/rollup-linux-arm-musleabihf@4.55.1': + resolution: {integrity: sha512-grPNWydeKtc1aEdrJDWk4opD7nFtQbMmV7769hiAaYyUKCT1faPRm2av8CX1YJsZ4TLAZcg9gTR1KvEzoLjXkg==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.54.0': - resolution: {integrity: sha512-NSqc7rE9wuUaRBsBp5ckQ5CVz5aIRKCwsoa6WMF7G01sX3/qHUw/z4pv+D+ahL1EIKy6Enpcnz1RY8pf7bjwng==} + '@rollup/rollup-linux-arm64-gnu@4.55.1': + resolution: {integrity: sha512-a59mwd1k6x8tXKcUxSyISiquLwB5pX+fJW9TkWU46lCqD/GRDe9uDN31jrMmVP3feI3mhAdvcCClhV8V5MhJFQ==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.54.0': - resolution: {integrity: sha512-gr5vDbg3Bakga5kbdpqx81m2n9IX8M6gIMlQQIXiLTNeQW6CucvuInJ91EuCJ/JYvc+rcLLsDFcfAD1K7fMofg==} + '@rollup/rollup-linux-arm64-musl@4.55.1': + resolution: {integrity: sha512-puS1MEgWX5GsHSoiAsF0TYrpomdvkaXm0CofIMG5uVkP6IBV+ZO9xhC5YEN49nsgYo1DuuMquF9+7EDBVYu4uA==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-loong64-gnu@4.54.0': - resolution: {integrity: sha512-gsrtB1NA3ZYj2vq0Rzkylo9ylCtW/PhpLEivlgWe0bpgtX5+9j9EZa0wtZiCjgu6zmSeZWyI/e2YRX1URozpIw==} + '@rollup/rollup-linux-loong64-gnu@4.55.1': + resolution: {integrity: sha512-r3Wv40in+lTsULSb6nnoudVbARdOwb2u5fpeoOAZjFLznp6tDU8kd+GTHmJoqZ9lt6/Sys33KdIHUaQihFcu7g==} cpu: [loong64] os: [linux] - '@rollup/rollup-linux-ppc64-gnu@4.54.0': - resolution: {integrity: sha512-y3qNOfTBStmFNq+t4s7Tmc9hW2ENtPg8FeUD/VShI7rKxNW7O4fFeaYbMsd3tpFlIg1Q8IapFgy7Q9i2BqeBvA==} + '@rollup/rollup-linux-loong64-musl@4.55.1': + resolution: {integrity: sha512-MR8c0+UxAlB22Fq4R+aQSPBayvYa3+9DrwG/i1TKQXFYEaoW3B5b/rkSRIypcZDdWjWnpcvxbNaAJDcSbJU3Lw==} + cpu: [loong64] + os: [linux] + + '@rollup/rollup-linux-ppc64-gnu@4.55.1': + resolution: {integrity: sha512-3KhoECe1BRlSYpMTeVrD4sh2Pw2xgt4jzNSZIIPLFEsnQn9gAnZagW9+VqDqAHgm1Xc77LzJOo2LdigS5qZ+gw==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.54.0': - resolution: {integrity: sha512-89sepv7h2lIVPsFma8iwmccN7Yjjtgz0Rj/Ou6fEqg3HDhpCa+Et+YSufy27i6b0Wav69Qv4WBNl3Rs6pwhebQ==} + '@rollup/rollup-linux-ppc64-musl@4.55.1': + resolution: {integrity: sha512-ziR1OuZx0vdYZZ30vueNZTg73alF59DicYrPViG0NEgDVN8/Jl87zkAPu4u6VjZST2llgEUjaiNl9JM6HH1Vdw==} + cpu: [ppc64] + os: [linux] + + '@rollup/rollup-linux-riscv64-gnu@4.55.1': + resolution: {integrity: sha512-uW0Y12ih2XJRERZ4jAfKamTyIHVMPQnTZcQjme2HMVDAHY4amf5u414OqNYC+x+LzRdRcnIG1YodLrrtA8xsxw==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-riscv64-musl@4.54.0': - resolution: {integrity: sha512-ZcU77ieh0M2Q8Ur7D5X7KvK+UxbXeDHwiOt/CPSBTI1fBmeDMivW0dPkdqkT4rOgDjrDDBUed9x4EgraIKoR2A==} + '@rollup/rollup-linux-riscv64-musl@4.55.1': + resolution: {integrity: sha512-u9yZ0jUkOED1BFrqu3BwMQoixvGHGZ+JhJNkNKY/hyoEgOwlqKb62qu+7UjbPSHYjiVy8kKJHvXKv5coH4wDeg==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.54.0': - resolution: {integrity: sha512-2AdWy5RdDF5+4YfG/YesGDDtbyJlC9LHmL6rZw6FurBJ5n4vFGupsOBGfwMRjBYH7qRQowT8D/U4LoSvVwOhSQ==} + '@rollup/rollup-linux-s390x-gnu@4.55.1': + resolution: {integrity: sha512-/0PenBCmqM4ZUd0190j7J0UsQ/1nsi735iPRakO8iPciE7BQ495Y6msPzaOmvx0/pn+eJVVlZrNrSh4WSYLxNg==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.54.0': - resolution: {integrity: sha512-WGt5J8Ij/rvyqpFexxk3ffKqqbLf9AqrTBbWDk7ApGUzaIs6V+s2s84kAxklFwmMF/vBNGrVdYgbblCOFFezMQ==} + '@rollup/rollup-linux-x64-gnu@4.55.1': + resolution: {integrity: sha512-a8G4wiQxQG2BAvo+gU6XrReRRqj+pLS2NGXKm8io19goR+K8lw269eTrPkSdDTALwMmJp4th2Uh0D8J9bEV1vg==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.54.0': - resolution: {integrity: sha512-JzQmb38ATzHjxlPHuTH6tE7ojnMKM2kYNzt44LO/jJi8BpceEC8QuXYA908n8r3CNuG/B3BV8VR3Hi1rYtmPiw==} + '@rollup/rollup-linux-x64-musl@4.55.1': + resolution: {integrity: sha512-bD+zjpFrMpP/hqkfEcnjXWHMw5BIghGisOKPj+2NaNDuVT+8Ds4mPf3XcPHuat1tz89WRL+1wbcxKY3WSbiT7w==} cpu: [x64] os: [linux] - '@rollup/rollup-openharmony-arm64@4.54.0': - resolution: {integrity: sha512-huT3fd0iC7jigGh7n3q/+lfPcXxBi+om/Rs3yiFxjvSxbSB6aohDFXbWvlspaqjeOh+hx7DDHS+5Es5qRkWkZg==} + '@rollup/rollup-openbsd-x64@4.55.1': + resolution: {integrity: sha512-eLXw0dOiqE4QmvikfQ6yjgkg/xDM+MdU9YJuP4ySTibXU0oAvnEWXt7UDJmD4UkYialMfOGFPJnIHSe/kdzPxg==} + cpu: [x64] + os: [openbsd] + + '@rollup/rollup-openharmony-arm64@4.55.1': + resolution: {integrity: sha512-xzm44KgEP11te3S2HCSyYf5zIzWmx3n8HDCc7EE59+lTcswEWNpvMLfd9uJvVX8LCg9QWG67Xt75AuHn4vgsXw==} cpu: [arm64] os: [openharmony] - '@rollup/rollup-win32-arm64-msvc@4.54.0': - resolution: {integrity: sha512-c2V0W1bsKIKfbLMBu/WGBz6Yci8nJ/ZJdheE0EwB73N3MvHYKiKGs3mVilX4Gs70eGeDaMqEob25Tw2Gb9Nqyw==} + '@rollup/rollup-win32-arm64-msvc@4.55.1': + resolution: {integrity: sha512-yR6Bl3tMC/gBok5cz/Qi0xYnVbIxGx5Fcf/ca0eB6/6JwOY+SRUcJfI0OpeTpPls7f194as62thCt/2BjxYN8g==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.54.0': - resolution: {integrity: sha512-woEHgqQqDCkAzrDhvDipnSirm5vxUXtSKDYTVpZG3nUdW/VVB5VdCYA2iReSj/u3yCZzXID4kuKG7OynPnB3WQ==} + '@rollup/rollup-win32-ia32-msvc@4.55.1': + resolution: {integrity: sha512-3fZBidchE0eY0oFZBnekYCfg+5wAB0mbpCBuofh5mZuzIU/4jIVkbESmd2dOsFNS78b53CYv3OAtwqkZZmU5nA==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-gnu@4.54.0': - resolution: {integrity: sha512-dzAc53LOuFvHwbCEOS0rPbXp6SIhAf2txMP5p6mGyOXXw5mWY8NGGbPMPrs4P1WItkfApDathBj/NzMLUZ9rtQ==} + '@rollup/rollup-win32-x64-gnu@4.55.1': + resolution: {integrity: sha512-xGGY5pXj69IxKb4yv/POoocPy/qmEGhimy/FoTpTSVju3FYXUQQMFCaZZXJVidsmGxRioZAwpThl/4zX41gRKg==} cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.54.0': - resolution: {integrity: sha512-hYT5d3YNdSh3mbCU1gwQyPgQd3T2ne0A3KG8KSBdav5TiBg6eInVmV+TeR5uHufiIgSFg0XsOWGW5/RhNcSvPg==} + '@rollup/rollup-win32-x64-msvc@4.55.1': + resolution: {integrity: sha512-SPEpaL6DX4rmcXtnhdrQYgzQ5W2uW3SCJch88lB2zImhJRhIIK44fkUrgIV/Q8yUNfw5oyZ5vkeQsZLhCb06lw==} cpu: [x64] os: [win32] @@ -2151,8 +2166,8 @@ packages: resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - rollup@4.54.0: - resolution: {integrity: sha512-3nk8Y3a9Ea8szgKhinMlGMhGMw89mqule3KWczxhIzqudyHdCIOHw8WJlj/r329fACjKLEh13ZSk7oE22kyeIw==} + rollup@4.55.1: + resolution: {integrity: sha512-wDv/Ht1BNHB4upNbK74s9usvl7hObDnvVzknxqY/E/O3X6rW1U1rV1aENEfJ54eFZDTNo7zv1f5N4edCluH7+A==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -3290,95 +3305,104 @@ snapshots: dependencies: quansync: 0.2.10 - '@rollup/plugin-terser@0.4.4(rollup@4.54.0)': + '@rollup/plugin-terser@0.4.4(rollup@4.55.1)': dependencies: serialize-javascript: 6.0.2 smob: 1.5.0 terser: 5.43.1 optionalDependencies: - rollup: 4.54.0 + rollup: 4.55.1 - '@rollup/plugin-typescript@12.3.0(rollup@4.54.0)(tslib@2.8.1)(typescript@5.8.3)': + '@rollup/plugin-typescript@12.3.0(rollup@4.55.1)(tslib@2.8.1)(typescript@5.8.3)': dependencies: - '@rollup/pluginutils': 5.2.0(rollup@4.54.0) + '@rollup/pluginutils': 5.2.0(rollup@4.55.1) resolve: 1.22.10 typescript: 5.8.3 optionalDependencies: - rollup: 4.54.0 + rollup: 4.55.1 tslib: 2.8.1 - '@rollup/pluginutils@5.2.0(rollup@4.54.0)': + '@rollup/pluginutils@5.2.0(rollup@4.55.1)': dependencies: '@types/estree': 1.0.8 estree-walker: 2.0.2 picomatch: 4.0.3 optionalDependencies: - rollup: 4.54.0 + rollup: 4.55.1 - '@rollup/rollup-android-arm-eabi@4.54.0': + '@rollup/rollup-android-arm-eabi@4.55.1': optional: true - '@rollup/rollup-android-arm64@4.54.0': + '@rollup/rollup-android-arm64@4.55.1': optional: true - '@rollup/rollup-darwin-arm64@4.54.0': + '@rollup/rollup-darwin-arm64@4.55.1': optional: true - '@rollup/rollup-darwin-x64@4.54.0': + '@rollup/rollup-darwin-x64@4.55.1': optional: true - '@rollup/rollup-freebsd-arm64@4.54.0': + '@rollup/rollup-freebsd-arm64@4.55.1': optional: true - '@rollup/rollup-freebsd-x64@4.54.0': + '@rollup/rollup-freebsd-x64@4.55.1': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.54.0': + '@rollup/rollup-linux-arm-gnueabihf@4.55.1': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.54.0': + '@rollup/rollup-linux-arm-musleabihf@4.55.1': optional: true - '@rollup/rollup-linux-arm64-gnu@4.54.0': + '@rollup/rollup-linux-arm64-gnu@4.55.1': optional: true - '@rollup/rollup-linux-arm64-musl@4.54.0': + '@rollup/rollup-linux-arm64-musl@4.55.1': optional: true - '@rollup/rollup-linux-loong64-gnu@4.54.0': + '@rollup/rollup-linux-loong64-gnu@4.55.1': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.54.0': + '@rollup/rollup-linux-loong64-musl@4.55.1': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.54.0': + '@rollup/rollup-linux-ppc64-gnu@4.55.1': optional: true - '@rollup/rollup-linux-riscv64-musl@4.54.0': + '@rollup/rollup-linux-ppc64-musl@4.55.1': optional: true - '@rollup/rollup-linux-s390x-gnu@4.54.0': + '@rollup/rollup-linux-riscv64-gnu@4.55.1': optional: true - '@rollup/rollup-linux-x64-gnu@4.54.0': + '@rollup/rollup-linux-riscv64-musl@4.55.1': optional: true - '@rollup/rollup-linux-x64-musl@4.54.0': + '@rollup/rollup-linux-s390x-gnu@4.55.1': optional: true - '@rollup/rollup-openharmony-arm64@4.54.0': + '@rollup/rollup-linux-x64-gnu@4.55.1': optional: true - '@rollup/rollup-win32-arm64-msvc@4.54.0': + '@rollup/rollup-linux-x64-musl@4.55.1': optional: true - '@rollup/rollup-win32-ia32-msvc@4.54.0': + '@rollup/rollup-openbsd-x64@4.55.1': optional: true - '@rollup/rollup-win32-x64-gnu@4.54.0': + '@rollup/rollup-openharmony-arm64@4.55.1': optional: true - '@rollup/rollup-win32-x64-msvc@4.54.0': + '@rollup/rollup-win32-arm64-msvc@4.55.1': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.55.1': + optional: true + + '@rollup/rollup-win32-x64-gnu@4.55.1': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.55.1': optional: true '@standard-schema/spec@1.0.0': {} @@ -4385,32 +4409,35 @@ snapshots: reusify@1.1.0: {} - rollup@4.54.0: + rollup@4.55.1: dependencies: '@types/estree': 1.0.8 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.54.0 - '@rollup/rollup-android-arm64': 4.54.0 - '@rollup/rollup-darwin-arm64': 4.54.0 - '@rollup/rollup-darwin-x64': 4.54.0 - '@rollup/rollup-freebsd-arm64': 4.54.0 - '@rollup/rollup-freebsd-x64': 4.54.0 - '@rollup/rollup-linux-arm-gnueabihf': 4.54.0 - '@rollup/rollup-linux-arm-musleabihf': 4.54.0 - '@rollup/rollup-linux-arm64-gnu': 4.54.0 - '@rollup/rollup-linux-arm64-musl': 4.54.0 - '@rollup/rollup-linux-loong64-gnu': 4.54.0 - '@rollup/rollup-linux-ppc64-gnu': 4.54.0 - '@rollup/rollup-linux-riscv64-gnu': 4.54.0 - '@rollup/rollup-linux-riscv64-musl': 4.54.0 - '@rollup/rollup-linux-s390x-gnu': 4.54.0 - '@rollup/rollup-linux-x64-gnu': 4.54.0 - '@rollup/rollup-linux-x64-musl': 4.54.0 - '@rollup/rollup-openharmony-arm64': 4.54.0 - '@rollup/rollup-win32-arm64-msvc': 4.54.0 - '@rollup/rollup-win32-ia32-msvc': 4.54.0 - '@rollup/rollup-win32-x64-gnu': 4.54.0 - '@rollup/rollup-win32-x64-msvc': 4.54.0 + '@rollup/rollup-android-arm-eabi': 4.55.1 + '@rollup/rollup-android-arm64': 4.55.1 + '@rollup/rollup-darwin-arm64': 4.55.1 + '@rollup/rollup-darwin-x64': 4.55.1 + '@rollup/rollup-freebsd-arm64': 4.55.1 + '@rollup/rollup-freebsd-x64': 4.55.1 + '@rollup/rollup-linux-arm-gnueabihf': 4.55.1 + '@rollup/rollup-linux-arm-musleabihf': 4.55.1 + '@rollup/rollup-linux-arm64-gnu': 4.55.1 + '@rollup/rollup-linux-arm64-musl': 4.55.1 + '@rollup/rollup-linux-loong64-gnu': 4.55.1 + '@rollup/rollup-linux-loong64-musl': 4.55.1 + '@rollup/rollup-linux-ppc64-gnu': 4.55.1 + '@rollup/rollup-linux-ppc64-musl': 4.55.1 + '@rollup/rollup-linux-riscv64-gnu': 4.55.1 + '@rollup/rollup-linux-riscv64-musl': 4.55.1 + '@rollup/rollup-linux-s390x-gnu': 4.55.1 + '@rollup/rollup-linux-x64-gnu': 4.55.1 + '@rollup/rollup-linux-x64-musl': 4.55.1 + '@rollup/rollup-openbsd-x64': 4.55.1 + '@rollup/rollup-openharmony-arm64': 4.55.1 + '@rollup/rollup-win32-arm64-msvc': 4.55.1 + '@rollup/rollup-win32-ia32-msvc': 4.55.1 + '@rollup/rollup-win32-x64-gnu': 4.55.1 + '@rollup/rollup-win32-x64-msvc': 4.55.1 fsevents: 2.3.3 run-parallel@1.2.0: @@ -4652,7 +4679,7 @@ snapshots: fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 postcss: 8.5.6 - rollup: 4.54.0 + rollup: 4.55.1 tinyglobby: 0.2.15 optionalDependencies: '@types/node': 24.10.0 From 9a53c84ec0a41ea1d784e02e13aa90b94a4c8a8e Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 15 Jan 2026 12:28:04 +0100 Subject: [PATCH 40/57] chore(deps): update dependency globals to v17 (#14730) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- packages/api/package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/api/package.json b/packages/api/package.json index b514d120f..6a08a7dd3 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -54,7 +54,7 @@ "eslint-config-prettier": "10.1.8", "eslint-plugin-security": "3.0.1", "fast-glob": "3.3.3", - "globals": "^16.2.0", + "globals": "^17.0.0", "rollup": "4.55.1", "tslib": "^2.8.1", "typescript": "^5.8.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 00adfe120..0acf16256 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -86,8 +86,8 @@ importers: specifier: 3.3.3 version: 3.3.3 globals: - specifier: ^16.2.0 - version: 16.2.0 + specifier: ^17.0.0 + version: 17.0.0 rollup: specifier: 4.55.1 version: 4.55.1 @@ -1873,8 +1873,8 @@ packages: resolution: {integrity: sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==} engines: {node: '>=18'} - globals@16.2.0: - resolution: {integrity: sha512-O+7l9tPdHCU320IigZZPj5zmRCFG9xHmx9cU8FqU2Rp+JN714seHV+2S9+JslCpY4gJwU2vOGox0wzgae/MCEg==} + globals@17.0.0: + resolution: {integrity: sha512-gv5BeD2EssA793rlFWVPMMCqefTlpusw6/2TbAVMy0FzcG8wKJn4O+NqJ4+XWmmwrayJgw5TzrmWjFgmz1XPqw==} engines: {node: '>=18'} graphemer@1.4.0: @@ -4152,7 +4152,7 @@ snapshots: globals@15.15.0: {} - globals@16.2.0: {} + globals@17.0.0: {} graphemer@1.4.0: {} From 07788af13fa87038fcaf4121dd9ee28b19ef44cd Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 15 Jan 2026 12:53:18 +0100 Subject: [PATCH 41/57] chore(deps): update rust crate signal-hook-tokio to 0.4 (#14729) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: FabianLars --- Cargo.lock | 8 ++++---- crates/tauri-driver/Cargo.toml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 777ea58a4..aae0d652c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7853,9 +7853,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook" -version = "0.3.17" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" +checksum = "2a37d01603c37b5466f808de79f845c7116049b0579adb70a6b7d47c1fa3a952" dependencies = [ "libc", "signal-hook-registry", @@ -7872,9 +7872,9 @@ dependencies = [ [[package]] name = "signal-hook-tokio" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213241f76fb1e37e27de3b6aa1b068a2c333233b59cca6634f634b80a27ecf1e" +checksum = "e513e435a8898a0002270f29d0a708b7879708fb5c4d00e46983ca2d2d378cf0" dependencies = [ "futures-core", "libc", diff --git a/crates/tauri-driver/Cargo.toml b/crates/tauri-driver/Cargo.toml index ad44b8a89..9b35fe111 100644 --- a/crates/tauri-driver/Cargo.toml +++ b/crates/tauri-driver/Cargo.toml @@ -31,8 +31,8 @@ tokio = { version = "1", features = ["macros"] } which = "8" [target."cfg(unix)".dependencies] -signal-hook = "0.3" -signal-hook-tokio = { version = "0.3", features = ["futures-v0_3"] } +signal-hook = "0.4" +signal-hook-tokio = { version = "0.4", features = ["futures-v0_3"] } [target."cfg(windows)".dependencies] win32job = "2" From 268bb339f0c512f021cc94e102573432cf2696d0 Mon Sep 17 00:00:00 2001 From: sftse Date: Thu, 15 Jan 2026 13:14:30 +0100 Subject: [PATCH 42/57] build(tauri-macos-sign): remove once-cell-regex (#14766) Co-authored-by: Fabian-Lars --- .changes/change-pr-14766.md | 5 +++++ Cargo.lock | 3 ++- crates/tauri-macos-sign/Cargo.toml | 3 ++- crates/tauri-macos-sign/src/keychain/identity.rs | 10 ++++++---- 4 files changed, 15 insertions(+), 6 deletions(-) create mode 100644 .changes/change-pr-14766.md diff --git a/.changes/change-pr-14766.md b/.changes/change-pr-14766.md new file mode 100644 index 000000000..4fb885f88 --- /dev/null +++ b/.changes/change-pr-14766.md @@ -0,0 +1,5 @@ +--- +"tauri-macos-sign": patch:deps +--- + +Remove once-cell-regex from direct dependencies. diff --git a/Cargo.lock b/Cargo.lock index aae0d652c..c9d5e6511 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8799,11 +8799,12 @@ dependencies = [ "chrono", "dirs 6.0.0", "log", - "once-cell-regex", + "once_cell", "os_pipe", "p12", "plist", "rand 0.9.1", + "regex", "serde", "serde_json", "tempfile", diff --git a/crates/tauri-macos-sign/Cargo.toml b/crates/tauri-macos-sign/Cargo.toml index 9fc874364..309938c27 100644 --- a/crates/tauri-macos-sign/Cargo.toml +++ b/crates/tauri-macos-sign/Cargo.toml @@ -15,7 +15,8 @@ serde = { version = "1", features = ["derive"] } serde_json = "1" tempfile = "3" x509-certificate = "0.23" -once-cell-regex = "0.2" +once_cell = "1" +regex = "1" os_pipe = "1" plist = "1" rand = "0.9" diff --git a/crates/tauri-macos-sign/src/keychain/identity.rs b/crates/tauri-macos-sign/src/keychain/identity.rs index a39c48423..6ac146915 100644 --- a/crates/tauri-macos-sign/src/keychain/identity.rs +++ b/crates/tauri-macos-sign/src/keychain/identity.rs @@ -2,7 +2,8 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use once_cell_regex::regex; +use once_cell::sync::OnceCell; +use regex::Regex; use std::{collections::BTreeSet, path::Path, process::Command}; use x509_certificate::certificate::X509Certificate; @@ -49,9 +50,10 @@ impl Team { organization } else { println!( - "found cert {common_name:?} but failed to get organization; falling back to displaying common name" - ); - regex!(r"Apple Develop\w+: (.*) \(.+\)") + "found cert {common_name:?} but failed to get organization; falling back to displaying common name" + ); + static APPLE_DEV: OnceCell = OnceCell::new(); + APPLE_DEV.get_or_init(|| Regex::new(r"Apple Develop\w+: (.*) \(.+\)").unwrap()) .captures(&common_name) .map(|caps| caps[1].to_owned()) .unwrap_or_else(|| { From 75057c7c08f0d4d3dd8d10cea4e2217e5d61fe1a Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Thu, 15 Jan 2026 14:48:45 +0100 Subject: [PATCH 43/57] chore(deps): update wry to 0.54 and webkit2gtk-rs to 2.0.2 (#14778) --- .changes/webkitgtk202.md | 7 +++++++ .changes/wry-054.md | 6 ++++++ Cargo.lock | 12 ++++++------ crates/tauri-runtime-wry/Cargo.toml | 2 +- crates/tauri/Cargo.toml | 2 +- 5 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 .changes/webkitgtk202.md create mode 100644 .changes/wry-054.md diff --git a/.changes/webkitgtk202.md b/.changes/webkitgtk202.md new file mode 100644 index 000000000..07f547e4c --- /dev/null +++ b/.changes/webkitgtk202.md @@ -0,0 +1,7 @@ +--- +tauri-runtime-wry: patch:deps +tauri-runtime: patch:deps +tauri: patch:deps +--- + +**Breaking Change** for `with_webview` users: Updated webkit2gtk-rs crates to `v2.0.2`. \ No newline at end of file diff --git a/.changes/wry-054.md b/.changes/wry-054.md new file mode 100644 index 000000000..9e4a0cdbe --- /dev/null +++ b/.changes/wry-054.md @@ -0,0 +1,6 @@ +--- +tauri-runtime-wry: patch:deps +tauri: patch:deps +--- + +Update wry to `v0.54`. \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index c9d5e6511..2df411247 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10173,9 +10173,9 @@ dependencies = [ [[package]] name = "webkit2gtk" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76b1bc1e54c581da1e9f179d0b38512ba358fb1af2d634a1affe42e37172361a" +checksum = "a1027150013530fb2eaf806408df88461ae4815a45c541c8975e61d6f2fc4793" dependencies = [ "bitflags 1.3.2", "cairo-rs", @@ -10197,9 +10197,9 @@ dependencies = [ [[package]] name = "webkit2gtk-sys" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62daa38afc514d1f8f12b8693d30d5993ff77ced33ce30cd04deebc267a6d57c" +checksum = "916a5f65c2ef0dfe12fff695960a2ec3d4565359fdbb2e9943c974e06c734ea5" dependencies = [ "bitflags 1.3.2", "cairo-sys-rs", @@ -10916,9 +10916,9 @@ checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] name = "wry" -version = "0.53.4" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d78ec082b80fa088569a970d043bb3050abaabf4454101d44514ee8d9a8c9f6" +checksum = "e456eeaf7f09413fdc16799782879b2b9f1d264dfdbce4cf7e924df0ef36afb9" dependencies = [ "base64 0.22.1", "block2 0.6.0", diff --git a/crates/tauri-runtime-wry/Cargo.toml b/crates/tauri-runtime-wry/Cargo.toml index 339b07f4a..3abe48253 100644 --- a/crates/tauri-runtime-wry/Cargo.toml +++ b/crates/tauri-runtime-wry/Cargo.toml @@ -13,7 +13,7 @@ edition.workspace = true rust-version.workspace = true [dependencies] -wry = { version = "0.53.4", default-features = false, features = [ +wry = { version = "0.54.0", default-features = false, features = [ "drag-drop", "protocol", "os-webview", diff --git a/crates/tauri/Cargo.toml b/crates/tauri/Cargo.toml index 72fb921b9..6d3c9137c 100644 --- a/crates/tauri/Cargo.toml +++ b/crates/tauri/Cargo.toml @@ -97,7 +97,7 @@ tray-icon = { version = "0.21", default-features = false, features = [ # linux [target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies] gtk = { version = "0.18", features = ["v3_24"] } -webkit2gtk = { version = "=2.0.1", features = ["v2_40"], optional = true } +webkit2gtk = { version = "=2.0.2", features = ["v2_40"], optional = true } # darwin [target.'cfg(target_vendor = "apple")'.dependencies] From 123d63a0c1b31a150cf459a93aa0ac0b79c2b5b8 Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Thu, 15 Jan 2026 17:00:58 +0100 Subject: [PATCH 44/57] chore: change webkit2gtk bump to minor --- .changes/webkitgtk202.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.changes/webkitgtk202.md b/.changes/webkitgtk202.md index 07f547e4c..739ce1ebd 100644 --- a/.changes/webkitgtk202.md +++ b/.changes/webkitgtk202.md @@ -1,7 +1,7 @@ --- -tauri-runtime-wry: patch:deps -tauri-runtime: patch:deps -tauri: patch:deps +tauri-runtime-wry: minor:deps +tauri-runtime: minor:deps +tauri: minor:deps --- -**Breaking Change** for `with_webview` users: Updated webkit2gtk-rs crates to `v2.0.2`. \ No newline at end of file +**Breaking Change** for `with_webview` users: Updated webkit2gtk-rs crates to `v2.0.2`. From 7873c4a1c680b6809cc954ff904a6a7a536cfa3b Mon Sep 17 00:00:00 2001 From: yy Date: Sat, 17 Jan 2026 20:30:14 +0900 Subject: [PATCH 45/57] docs: fix typos in comments (#14787) --- crates/tauri-bundler/src/bundle/macos/sign.rs | 2 +- crates/tauri-bundler/src/bundle/settings.rs | 2 +- crates/tauri-runtime-wry/src/window/mod.rs | 2 +- crates/tauri-runtime/src/webview.rs | 2 +- crates/tauri/src/webview/mod.rs | 2 +- crates/tauri/src/webview/webview_window.rs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/tauri-bundler/src/bundle/macos/sign.rs b/crates/tauri-bundler/src/bundle/macos/sign.rs index 8d8bf6c2b..acde62708 100644 --- a/crates/tauri-bundler/src/bundle/macos/sign.rs +++ b/crates/tauri-bundler/src/bundle/macos/sign.rs @@ -21,7 +21,7 @@ pub fn keychain(identity: Option<&str>) -> crate::Result>, - /// the list of of RPM dependencies your application recommends. + /// the list of RPM dependencies your application recommends. pub recommends: Option>, /// The list of RPM dependencies your application provides. pub provides: Option>, diff --git a/crates/tauri-runtime-wry/src/window/mod.rs b/crates/tauri-runtime-wry/src/window/mod.rs index 6fb2dbe17..b18543e5d 100644 --- a/crates/tauri-runtime-wry/src/window/mod.rs +++ b/crates/tauri-runtime-wry/src/window/mod.rs @@ -39,7 +39,7 @@ pub trait WindowExt { /// - **Android / iOS**: Unsupported. fn center(&self) {} - /// Clears the window surface. i.e make it it transparent. + /// Clears the window surface. i.e make it transparent. #[cfg(windows)] fn draw_surface( &self, diff --git a/crates/tauri-runtime/src/webview.rs b/crates/tauri-runtime/src/webview.rs index efce7d814..80f7edf0e 100644 --- a/crates/tauri-runtime/src/webview.rs +++ b/crates/tauri-runtime/src/webview.rs @@ -363,7 +363,7 @@ pub struct WebviewAttributes { /// see https://docs.rs/objc2-web-kit/latest/objc2_web_kit/struct.WKWebView.html#method.allowsLinkPreview pub allow_link_preview: bool, pub scroll_bar_style: ScrollBarStyle, - /// Allows overriding the the keyboard accessory view on iOS. + /// Allows overriding the keyboard accessory view on iOS. /// Returning `None` effectively removes the view. /// /// The closure parameter is the webview instance. diff --git a/crates/tauri/src/webview/mod.rs b/crates/tauri/src/webview/mod.rs index 44d9e0a36..4df09182a 100644 --- a/crates/tauri/src/webview/mod.rs +++ b/crates/tauri/src/webview/mod.rs @@ -1202,7 +1202,7 @@ fn main() { self } - /// Allows overriding the the keyboard accessory view on iOS. + /// Allows overriding the keyboard accessory view on iOS. /// Returning `None` effectively removes the view. /// /// The closure parameter is the webview instance. diff --git a/crates/tauri/src/webview/webview_window.rs b/crates/tauri/src/webview/webview_window.rs index f3c8665c3..92b033b06 100644 --- a/crates/tauri/src/webview/webview_window.rs +++ b/crates/tauri/src/webview/webview_window.rs @@ -1230,7 +1230,7 @@ impl> WebviewWindowBuilder<'_, R, M> { self } - /// Allows overriding the the keyboard accessory view on iOS. + /// Allows overriding the keyboard accessory view on iOS. /// Returning `None` effectively removes the view. /// /// The closure parameter is the webview instance. From 7f7d9aac214e22d9492490543f7a9bcae0a6659e Mon Sep 17 00:00:00 2001 From: sftse Date: Sat, 17 Jan 2026 16:52:42 +0100 Subject: [PATCH 46/57] Less statics (#14668) * refactor(tauri-cli): introduce replacement functions * refactor(tauri-cli): apply replacement to remove.rs * refactor(tauri-cli): apply replacement to icon.rs * refactor(tauri-cli): apply replacement to bundle.rs * refactor(tauri-cli): apply replacement to build.rs * refactor(tauri-cli): apply replacement to add.rs * refactor(tauri-cli): apply replacement to dev.rs * refactor(tauri-cli): less controlflow * refactor(tauri-cli): split config loading from locking static * refactor(tauri-cli): remove duplicate checks covered by if let Some(tauri_dir) = tauri_dir tauri_dir.is_some() must be true, otherwise the entire block is not run, so the frontend_dir check is irrelevant * fmt * refactor(tauri-cli): apply replacement to inspect.rs * refactor(tauri-cli): dont use statics for config * refactor(tauri-cli): finish threading directory paths through functions * fix: clippy * fixup CI * refactor(tauri-cli): dont need mutex * refactor(tauri-cli): rescope mutex use to minimal necessary * fix CI, reduce mutex use * fixup PR #14607 * fix: clippy * refactor(tauri-cli): remove ConfigHandle * refactor(tauri-cli): remove more unwraps and panicing functions * refactor(tauri-cli): less mutexes * refactor(tauri-cli): undo mistaken change, address review comment * Split android build to 2 functions * Pass in dirs to migration v1 like the v2 beta * Add change file --------- Co-authored-by: Tony --- .changes/reduce-internal-statics.md | 6 + crates/tauri-cli/src/acl/capability/new.rs | 12 +- crates/tauri-cli/src/acl/permission/ls.rs | 6 +- crates/tauri-cli/src/add.rs | 20 ++- crates/tauri-cli/src/build.rs | 45 ++--- crates/tauri-cli/src/bundle.rs | 35 ++-- crates/tauri-cli/src/dev.rs | 114 +++++------- crates/tauri-cli/src/helpers/app_paths.rs | 30 ++-- .../tauri-cli/src/helpers/cargo_manifest.rs | 2 +- crates/tauri-cli/src/helpers/config.rs | 95 +++++----- crates/tauri-cli/src/helpers/mod.rs | 5 +- crates/tauri-cli/src/icon.rs | 5 +- crates/tauri-cli/src/info/app.rs | 74 ++++---- crates/tauri-cli/src/info/mod.rs | 14 +- crates/tauri-cli/src/info/plugins.rs | 44 ++--- crates/tauri-cli/src/inspect.rs | 26 +-- crates/tauri-cli/src/interface/mod.rs | 32 +++- crates/tauri-cli/src/interface/rust.rs | 165 +++++++++++------- .../tauri-cli/src/interface/rust/desktop.rs | 9 +- .../tauri-cli/src/interface/rust/manifest.rs | 9 +- .../src/migrate/migrations/v1/mod.rs | 34 ++-- .../src/migrate/migrations/v2_beta.rs | 16 +- crates/tauri-cli/src/migrate/mod.rs | 23 +-- .../mobile/android/android_studio_script.rs | 61 +++---- crates/tauri-cli/src/mobile/android/build.rs | 71 ++++---- crates/tauri-cli/src/mobile/android/dev.rs | 69 ++++---- crates/tauri-cli/src/mobile/android/mod.rs | 19 +- crates/tauri-cli/src/mobile/android/run.rs | 18 +- crates/tauri-cli/src/mobile/init.rs | 21 ++- crates/tauri-cli/src/mobile/ios/build.rs | 70 +++----- crates/tauri-cli/src/mobile/ios/dev.rs | 93 +++++----- crates/tauri-cli/src/mobile/ios/mod.rs | 51 ++---- crates/tauri-cli/src/mobile/ios/run.rs | 14 ++ .../tauri-cli/src/mobile/ios/xcode_script.rs | 55 +++--- crates/tauri-cli/src/mobile/mod.rs | 60 +++---- crates/tauri-cli/src/remove.rs | 17 +- 36 files changed, 682 insertions(+), 758 deletions(-) create mode 100644 .changes/reduce-internal-statics.md diff --git a/.changes/reduce-internal-statics.md b/.changes/reduce-internal-statics.md new file mode 100644 index 000000000..bc20780b1 --- /dev/null +++ b/.changes/reduce-internal-statics.md @@ -0,0 +1,6 @@ +--- +"@tauri-apps/cli": patch:changes +"tauri-cli": patch:changes +--- + +Refactored internal use of static on config and directory resolvings, no user facing changes, please report any regressions if you encounter any diff --git a/crates/tauri-cli/src/acl/capability/new.rs b/crates/tauri-cli/src/acl/capability/new.rs index aceddc05d..14324be18 100644 --- a/crates/tauri-cli/src/acl/capability/new.rs +++ b/crates/tauri-cli/src/acl/capability/new.rs @@ -7,12 +7,7 @@ use std::{collections::HashSet, path::PathBuf}; use clap::Parser; use tauri_utils::acl::capability::{Capability, PermissionEntry}; -use crate::{ - acl::FileFormat, - error::ErrorExt, - helpers::{app_paths::tauri_dir, prompts}, - Result, -}; +use crate::{acl::FileFormat, error::ErrorExt, helpers::prompts, Result}; #[derive(Debug, Parser)] #[clap(about = "Create a new permission file")] @@ -37,7 +32,7 @@ pub struct Options { } pub fn command(options: Options) -> Result<()> { - crate::helpers::app_paths::resolve(); + let dirs = crate::helpers::app_paths::resolve_dirs(); let identifier = match options.identifier { Some(i) => i, @@ -111,8 +106,7 @@ pub fn command(options: Options) -> Result<()> { .canonicalize() .fs_context("failed to canonicalize capability file path", o.clone())?, None => { - let dir = tauri_dir(); - let capabilities_dir = dir.join("capabilities"); + let capabilities_dir = dirs.tauri.join("capabilities"); capabilities_dir.join(format!( "{}.{}", capability.identifier, diff --git a/crates/tauri-cli/src/acl/permission/ls.rs b/crates/tauri-cli/src/acl/permission/ls.rs index 1265c3c24..ccebfebf0 100644 --- a/crates/tauri-cli/src/acl/permission/ls.rs +++ b/crates/tauri-cli/src/acl/permission/ls.rs @@ -6,7 +6,6 @@ use clap::Parser; use crate::{ error::{Context, ErrorExt}, - helpers::app_paths::tauri_dir, Result, }; use colored::Colorize; @@ -25,9 +24,10 @@ pub struct Options { } pub fn command(options: Options) -> Result<()> { - crate::helpers::app_paths::resolve(); + let dirs = crate::helpers::app_paths::resolve_dirs(); - let acl_manifests_path = tauri_dir() + let acl_manifests_path = dirs + .tauri .join("gen") .join("schemas") .join("acl-manifests.json"); diff --git a/crates/tauri-cli/src/add.rs b/crates/tauri-cli/src/add.rs index 8a45c0880..074b0e3b2 100644 --- a/crates/tauri-cli/src/add.rs +++ b/crates/tauri-cli/src/add.rs @@ -10,7 +10,7 @@ use crate::{ acl, error::ErrorExt, helpers::{ - app_paths::{resolve_frontend_dir, tauri_dir}, + app_paths::{resolve_frontend_dir, Dirs}, cargo, npm::PackageManager, }, @@ -39,11 +39,11 @@ pub struct Options { } pub fn command(options: Options) -> Result<()> { - crate::helpers::app_paths::resolve(); - run(options) + let dirs = crate::helpers::app_paths::resolve_dirs(); + run(options, &dirs) } -pub fn run(options: Options) -> Result<()> { +pub fn run(options: Options, dirs: &Dirs) -> Result<()> { let (plugin, version) = options .plugin .split_once('@') @@ -71,7 +71,6 @@ pub fn run(options: Options) -> Result<()> { } let frontend_dir = resolve_frontend_dir(); - let tauri_dir = tauri_dir(); let target_str = metadata .desktop_only @@ -90,7 +89,7 @@ pub fn run(options: Options) -> Result<()> { branch: options.branch.as_deref(), rev: options.rev.as_deref(), tag: options.tag.as_deref(), - cwd: Some(tauri_dir), + cwd: Some(dirs.tauri), target: target_str, })?; @@ -117,7 +116,7 @@ pub fn run(options: Options) -> Result<()> { (None, None, None, None) => npm_name, _ => crate::error::bail!("Only one of --tag, --rev and --branch can be specified"), }; - manager.install(&[npm_spec], tauri_dir)?; + manager.install(&[npm_spec], dirs.tauri)?; } let _ = acl::permission::add::command(acl::permission::add::Options { @@ -143,7 +142,10 @@ pub fn run(options: Options) -> Result<()> { let plugin_init = format!(".plugin(tauri_plugin_{plugin_snake_case}::{plugin_init_fn})"); let re = Regex::new(r"(tauri\s*::\s*Builder\s*::\s*default\(\))(\s*)").unwrap(); - for file in [tauri_dir.join("src/main.rs"), tauri_dir.join("src/lib.rs")] { + for file in [ + dirs.tauri.join("src/main.rs"), + dirs.tauri.join("src/lib.rs"), + ] { let contents = std::fs::read_to_string(&file).fs_context("failed to read Rust entry point", file.clone())?; @@ -166,7 +168,7 @@ pub fn run(options: Options) -> Result<()> { log::info!("Running `cargo fmt`..."); let _ = Command::new("cargo") .arg("fmt") - .current_dir(tauri_dir) + .current_dir(dirs.tauri) .status(); } diff --git a/crates/tauri-cli/src/build.rs b/crates/tauri-cli/src/build.rs index 0bd5a5320..754b1793e 100644 --- a/crates/tauri-cli/src/build.rs +++ b/crates/tauri-cli/src/build.rs @@ -7,8 +7,8 @@ use crate::{ error::{Context, ErrorExt}, helpers::{ self, - app_paths::{frontend_dir, tauri_dir}, - config::{get as get_config, ConfigMetadata, FrontendDist}, + app_paths::Dirs, + config::{get_config, ConfigMetadata, FrontendDist}, }, info::plugins::check_mismatched_packages, interface::{rust::get_cargo_target_dir, AppInterface, Interface}, @@ -82,7 +82,7 @@ pub struct Options { } pub fn command(mut options: Options, verbosity: u8) -> Result<()> { - crate::helpers::app_paths::resolve(); + let dirs = crate::helpers::app_paths::resolve_dirs(); if options.no_sign { log::warn!("--no-sign flag detected: Signing will be skipped."); @@ -99,42 +99,38 @@ pub fn command(mut options: Options, verbosity: u8) -> Result<()> { let config = get_config( target, &options.config.iter().map(|c| &c.0).collect::>(), + dirs.tauri, )?; - let mut interface = AppInterface::new( - config.lock().unwrap().as_ref().unwrap(), - options.target.clone(), - )?; + let mut interface = AppInterface::new(&config, options.target.clone(), dirs.tauri)?; - let config_guard = config.lock().unwrap(); - let config_ = config_guard.as_ref().unwrap(); + setup(&interface, &mut options, &config, false, &dirs)?; - setup(&interface, &mut options, config_, false)?; - - if let Some(minimum_system_version) = &config_.bundle.macos.minimum_system_version { + if let Some(minimum_system_version) = &config.bundle.macos.minimum_system_version { std::env::set_var("MACOSX_DEPLOYMENT_TARGET", minimum_system_version); } let app_settings = interface.app_settings(); let interface_options = options.clone().into(); - let out_dir = app_settings.out_dir(&interface_options)?; + let out_dir = app_settings.out_dir(&interface_options, dirs.tauri)?; - let bin_path = interface.build(interface_options)?; + let bin_path = interface.build(interface_options, &dirs)?; log::info!(action ="Built"; "application at: {}", tauri_utils::display_path(bin_path)); let app_settings = interface.app_settings(); - if !options.no_bundle && (config_.bundle.active || options.bundles.is_some()) { + if !options.no_bundle && (config.bundle.active || options.bundles.is_some()) { crate::bundle::bundle( &options.into(), verbosity, ci, &interface, &*app_settings, - config_, + &config, &out_dir, + &dirs, )?; } @@ -146,13 +142,12 @@ pub fn setup( options: &mut Options, config: &ConfigMetadata, mobile: bool, + dirs: &Dirs, ) -> Result<()> { - let tauri_path = tauri_dir(); - // TODO: Maybe optimize this to run in parallel in the future // see https://github.com/tauri-apps/tauri/pull/13993#discussion_r2280697117 log::info!("Looking up installed tauri packages to check mismatched versions..."); - if let Err(error) = check_mismatched_packages(frontend_dir(), tauri_path) { + if let Err(error) = check_mismatched_packages(dirs.frontend, dirs.tauri) { if options.ignore_version_mismatches { log::error!("{error}"); } else { @@ -160,7 +155,7 @@ pub fn setup( } } - set_current_dir(tauri_path).context("failed to set current directory")?; + set_current_dir(dirs.tauri).context("failed to set current directory")?; let bundle_identifier_source = config .find_bundle_identifier_overwriter() @@ -191,7 +186,13 @@ pub fn setup( } if let Some(before_build) = config.build.before_build_command.clone() { - helpers::run_hook("beforeBuildCommand", before_build, interface, options.debug)?; + helpers::run_hook( + "beforeBuildCommand", + before_build, + interface, + options.debug, + dirs.frontend, + )?; } if let Some(FrontendDist::Directory(web_asset_path)) = &config.build.frontend_dist { @@ -219,7 +220,7 @@ pub fn setup( // Issue #13287 - Allow the use of target dir inside frontendDist/distDir // https://github.com/tauri-apps/tauri/issues/13287 - let target_path = get_cargo_target_dir(&options.args)?; + let target_path = get_cargo_target_dir(&options.args, dirs.tauri)?; let mut out_folders = Vec::new(); if let Ok(web_asset_canonical) = dunce::canonicalize(web_asset_path) { if let Ok(relative_path) = target_path.strip_prefix(&web_asset_canonical) { diff --git a/crates/tauri-cli/src/bundle.rs b/crates/tauri-cli/src/bundle.rs index 8c1f320b5..57e4a6f38 100644 --- a/crates/tauri-cli/src/bundle.rs +++ b/crates/tauri-cli/src/bundle.rs @@ -16,8 +16,8 @@ use crate::{ error::{Context, ErrorExt}, helpers::{ self, - app_paths::tauri_dir, - config::{get as get_config, ConfigMetadata}, + app_paths::Dirs, + config::{get_config, ConfigMetadata}, updater_signature, }, interface::{AppInterface, AppSettings, Interface}, @@ -118,7 +118,7 @@ impl From for Options { } pub fn command(options: Options, verbosity: u8) -> crate::Result<()> { - crate::helpers::app_paths::resolve(); + let dirs = crate::helpers::app_paths::resolve_dirs(); let ci = options.ci; @@ -131,27 +131,21 @@ pub fn command(options: Options, verbosity: u8) -> crate::Result<()> { let config = get_config( target, &options.config.iter().map(|c| &c.0).collect::>(), + dirs.tauri, )?; - let interface = AppInterface::new( - config.lock().unwrap().as_ref().unwrap(), - options.target.clone(), - )?; + let interface = AppInterface::new(&config, options.target.clone(), dirs.tauri)?; - let tauri_path = tauri_dir(); - std::env::set_current_dir(tauri_path).context("failed to set current directory")?; + std::env::set_current_dir(dirs.tauri).context("failed to set current directory")?; - let config_guard = config.lock().unwrap(); - let config_ = config_guard.as_ref().unwrap(); - - if let Some(minimum_system_version) = &config_.bundle.macos.minimum_system_version { + if let Some(minimum_system_version) = &config.bundle.macos.minimum_system_version { std::env::set_var("MACOSX_DEPLOYMENT_TARGET", minimum_system_version); } let app_settings = interface.app_settings(); let interface_options = options.clone().into(); - let out_dir = app_settings.out_dir(&interface_options)?; + let out_dir = app_settings.out_dir(&interface_options, dirs.tauri)?; bundle( &options, @@ -159,8 +153,9 @@ pub fn command(options: Options, verbosity: u8) -> crate::Result<()> { ci, &interface, &*app_settings, - config_, + &config, &out_dir, + &dirs, ) } @@ -173,6 +168,7 @@ pub fn bundle( app_settings: &A, config: &ConfigMetadata, out_dir: &Path, + dirs: &Dirs, ) -> crate::Result<()> { let package_types: Vec = if let Some(bundles) = &options.bundles { bundles.iter().map(|bundle| bundle.0).collect::>() @@ -198,12 +194,19 @@ pub fn bundle( before_bundle, interface, options.debug, + dirs.frontend, )?; } } let mut settings = app_settings - .get_bundler_settings(options.clone().into(), config, out_dir, package_types) + .get_bundler_settings( + options.clone().into(), + config, + out_dir, + package_types, + dirs.tauri, + ) .with_context(|| "failed to build bundler settings")?; settings.set_no_sign(options.no_sign); diff --git a/crates/tauri-cli/src/dev.rs b/crates/tauri-cli/src/dev.rs index e2ac61fce..5bf62ef10 100644 --- a/crates/tauri-cli/src/dev.rs +++ b/crates/tauri-cli/src/dev.rs @@ -5,11 +5,9 @@ use crate::{ error::{Context, ErrorExt}, helpers::{ - app_paths::{frontend_dir, tauri_dir}, + app_paths::Dirs, command_env, - config::{ - get as get_config, reload as reload_config, BeforeDevCommand, ConfigHandle, FrontendDist, - }, + config::{get_config, reload_config, BeforeDevCommand, ConfigMetadata, FrontendDist}, }, info::plugins::check_mismatched_packages, interface::{AppInterface, ExitReason, Interface}, @@ -99,61 +97,59 @@ pub struct Options { } pub fn command(options: Options) -> Result<()> { - crate::helpers::app_paths::resolve(); + let dirs = crate::helpers::app_paths::resolve_dirs(); - let r = command_internal(options); + let r = command_internal(options, dirs); if r.is_err() { kill_before_dev_process(); } r } -fn command_internal(mut options: Options) -> Result<()> { +fn command_internal(mut options: Options, dirs: Dirs) -> Result<()> { let target = options .target .as_deref() .map(Target::from_triple) .unwrap_or_else(Target::current); - let config = get_config( + let mut cfg = get_config( target, &options.config.iter().map(|c| &c.0).collect::>(), + dirs.tauri, )?; - let mut interface = AppInterface::new( - config.lock().unwrap().as_ref().unwrap(), - options.target.clone(), - )?; + let mut interface = AppInterface::new(&cfg, options.target.clone(), dirs.tauri)?; - setup(&interface, &mut options, config)?; + setup(&interface, &mut options, &mut cfg, &dirs)?; + + let config = Mutex::new(cfg); let exit_on_panic = options.exit_on_panic; let no_watch = options.no_watch; - interface.dev(options.into(), move |status, reason| { - on_app_exit(status, reason, exit_on_panic, no_watch) - }) + interface.dev( + &config, + options.into(), + move |status, reason| on_app_exit(status, reason, exit_on_panic, no_watch), + &dirs, + ) } -pub fn setup(interface: &AppInterface, options: &mut Options, config: ConfigHandle) -> Result<()> { - let tauri_path = tauri_dir(); - +pub fn setup( + interface: &AppInterface, + options: &mut Options, + config: &mut ConfigMetadata, + dirs: &Dirs, +) -> Result<()> { std::thread::spawn(|| { - if let Err(error) = check_mismatched_packages(frontend_dir(), tauri_path) { + if let Err(error) = check_mismatched_packages(dirs.frontend, dirs.tauri) { log::error!("{error}"); } }); - set_current_dir(tauri_path).context("failed to set current directory")?; + set_current_dir(dirs.tauri).context("failed to set current directory")?; - if let Some(before_dev) = config - .lock() - .unwrap() - .as_ref() - .unwrap() - .build - .before_dev_command - .clone() - { + if let Some(before_dev) = config.build.before_dev_command.clone() { let (script, script_cwd, wait) = match before_dev { BeforeDevCommand::Script(s) if s.is_empty() => (None, None, false), BeforeDevCommand::Script(s) => (Some(s), None, false), @@ -161,7 +157,7 @@ pub fn setup(interface: &AppInterface, options: &mut Options, config: ConfigHand (Some(script), cwd.map(Into::into), wait) } }; - let cwd = script_cwd.unwrap_or_else(|| frontend_dir().clone()); + let cwd = script_cwd.unwrap_or_else(|| dirs.frontend.to_owned()); if let Some(before_dev) = script { log::info!(action = "Running"; "BeforeDevCommand (`{}`)", before_dev); let mut env = command_env(true); @@ -235,43 +231,14 @@ pub fn setup(interface: &AppInterface, options: &mut Options, config: ConfigHand } if options.runner.is_none() { - options.runner = config - .lock() - .unwrap() - .as_ref() - .unwrap() - .build - .runner - .clone(); + options.runner = config.build.runner.clone(); } - let mut cargo_features = config - .lock() - .unwrap() - .as_ref() - .unwrap() - .build - .features - .clone() - .unwrap_or_default(); + let mut cargo_features = config.build.features.clone().unwrap_or_default(); cargo_features.extend(options.features.clone()); - let mut dev_url = config - .lock() - .unwrap() - .as_ref() - .unwrap() - .build - .dev_url - .clone(); - let frontend_dist = config - .lock() - .unwrap() - .as_ref() - .unwrap() - .build - .frontend_dist - .clone(); + let mut dev_url = config.build.dev_url.clone(); + let frontend_dist = config.build.frontend_dist.clone(); if !options.no_dev_server && dev_url.is_none() { if let Some(FrontendDist::Directory(path)) = &frontend_dist { if path.exists() { @@ -294,7 +261,11 @@ pub fn setup(interface: &AppInterface, options: &mut Options, config: ConfigHand } }))); - reload_config(&options.config.iter().map(|c| &c.0).collect::>())?; + reload_config( + config, + &options.config.iter().map(|c| &c.0).collect::>(), + dirs.tauri, + )?; } } } @@ -347,16 +318,9 @@ pub fn setup(interface: &AppInterface, options: &mut Options, config: ConfigHand } if options.additional_watch_folders.is_empty() { - options.additional_watch_folders.extend( - config - .lock() - .unwrap() - .as_ref() - .unwrap() - .build - .additional_watch_folders - .clone(), - ); + options + .additional_watch_folders + .extend(config.build.additional_watch_folders.clone()); } Ok(()) diff --git a/crates/tauri-cli/src/helpers/app_paths.rs b/crates/tauri-cli/src/helpers/app_paths.rs index 3c728f5ba..5b3e0d91a 100644 --- a/crates/tauri-cli/src/helpers/app_paths.rs +++ b/crates/tauri-cli/src/helpers/app_paths.rs @@ -23,6 +23,11 @@ const ENV_TAURI_APP_PATH: &str = "TAURI_APP_PATH"; // path to the frontend app directory, usually `/` const ENV_TAURI_FRONTEND_PATH: &str = "TAURI_FRONTEND_PATH"; +pub struct Dirs { + pub tauri: &'static Path, + pub frontend: &'static Path, +} + static FRONTEND_DIR: OnceLock = OnceLock::new(); static TAURI_DIR: OnceLock = OnceLock::new(); @@ -122,8 +127,8 @@ pub fn resolve_tauri_dir() -> Option { }) } -pub fn resolve() { - TAURI_DIR.set(resolve_tauri_dir().unwrap_or_else(|| { +pub fn resolve_dirs() -> Dirs { + let tauri = TAURI_DIR.get_or_init(|| resolve_tauri_dir().unwrap_or_else(|| { let env_var_name = env_tauri_app_path().is_some().then(|| format!("`{ENV_TAURI_APP_PATH}`")); panic!("Couldn't recognize the {} folder as a Tauri project. It must contain a `{}`, `{}` or `{}` file in any subfolder.", env_var_name.as_deref().unwrap_or("current"), @@ -131,16 +136,11 @@ pub fn resolve() { ConfigFormat::Json5.into_file_name(), ConfigFormat::Toml.into_file_name() ) - })).expect("tauri dir already resolved"); - FRONTEND_DIR - .set(resolve_frontend_dir().unwrap_or_else(|| tauri_dir().parent().unwrap().to_path_buf())) - .expect("app dir already resolved"); -} - -pub fn tauri_dir() -> &'static PathBuf { - TAURI_DIR - .get() - .expect("app paths not initialized, this is a Tauri CLI bug") + })); + let frontend = FRONTEND_DIR.get_or_init(|| { + resolve_frontend_dir().unwrap_or_else(|| tauri.parent().unwrap().to_path_buf()) + }); + Dirs { tauri, frontend } } pub fn resolve_frontend_dir() -> Option { @@ -165,9 +165,3 @@ pub fn resolve_frontend_dir() -> Option { }) .map(|p| p.parent().unwrap().to_path_buf()) } - -pub fn frontend_dir() -> &'static PathBuf { - FRONTEND_DIR - .get() - .expect("app paths not initialized, this is a Tauri CLI bug") -} diff --git a/crates/tauri-cli/src/helpers/cargo_manifest.rs b/crates/tauri-cli/src/helpers/cargo_manifest.rs index 0ccf71790..b1bfa9a10 100644 --- a/crates/tauri-cli/src/helpers/cargo_manifest.rs +++ b/crates/tauri-cli/src/helpers/cargo_manifest.rs @@ -56,7 +56,7 @@ pub fn cargo_manifest_and_lock(tauri_dir: &Path) -> (Option, Opti .ok() .and_then(|manifest_contents| toml::from_str(&manifest_contents).ok()); - let lock: Option = get_workspace_dir() + let lock: Option = get_workspace_dir(tauri_dir) .ok() .and_then(|p| fs::read_to_string(p.join("Cargo.lock")).ok()) .and_then(|s| toml::from_str(&s).ok()); diff --git a/crates/tauri-cli/src/helpers/config.rs b/crates/tauri-cli/src/helpers/config.rs index eb2a643de..d819867bd 100644 --- a/crates/tauri-cli/src/helpers/config.rs +++ b/crates/tauri-cli/src/helpers/config.rs @@ -13,8 +13,9 @@ use std::{ collections::HashMap, env::{current_dir, set_current_dir, set_var}, ffi::{OsStr, OsString}, + path::Path, process::exit, - sync::{Mutex, OnceLock}, + sync::OnceLock, }; use crate::error::Context; @@ -66,14 +67,11 @@ impl ConfigMetadata { } } -pub type ConfigHandle = &'static Mutex>; - pub fn wix_settings(config: WixConfig) -> tauri_bundler::WixSettings { tauri_bundler::WixSettings { version: config.version, upgrade_code: config.upgrade_code, - fips_compliant: std::env::var("TAURI_BUNDLER_WIX_FIPS_COMPLIANT") - .ok() + fips_compliant: std::env::var_os("TAURI_BUNDLER_WIX_FIPS_COMPLIANT") .map(|v| v == "true") .unwrap_or(config.fips_compliant), language: tauri_bundler::WixLanguage(match config.language { @@ -141,11 +139,6 @@ pub fn custom_sign_settings( } } -fn config_handle() -> ConfigHandle { - static CONFIG_HANDLE: Mutex> = Mutex::new(None); - &CONFIG_HANDLE -} - fn config_schema_validator() -> &'static jsonschema::Validator { // TODO: Switch to `LazyLock` when we bump MSRV to above 1.80 static CONFIG_SCHEMA_VALIDATOR: OnceLock = OnceLock::new(); @@ -156,17 +149,12 @@ fn config_schema_validator() -> &'static jsonschema::Validator { }) } -/// Gets the static parsed config from `tauri.conf.json`. -fn get_internal( +fn load_config( merge_configs: &[&serde_json::Value], reload: bool, target: Target, -) -> crate::Result { - if !reload && config_handle().lock().unwrap().is_some() { - return Ok(config_handle()); - } - - let tauri_dir = super::app_paths::tauri_dir(); + tauri_dir: &Path, +) -> crate::Result { let (mut config, config_path) = tauri_utils::config::parse::parse_value(target, tauri_dir.join("tauri.conf.json")) .context("failed to parse config")?; @@ -240,59 +228,54 @@ fn get_internal( std::env::set_var(REMOVE_UNUSED_COMMANDS_ENV_VAR, tauri_dir); } - *config_handle().lock().unwrap() = Some(ConfigMetadata { + Ok(ConfigMetadata { target, original_identifier, inner: config, extensions, - }); - - Ok(config_handle()) + }) } -pub fn get(target: Target, merge_configs: &[&serde_json::Value]) -> crate::Result { - get_internal(merge_configs, false, target) +pub fn get_config( + target: Target, + merge_configs: &[&serde_json::Value], + tauri_dir: &Path, +) -> crate::Result { + load_config(merge_configs, false, target, tauri_dir) } -pub fn reload(merge_configs: &[&serde_json::Value]) -> crate::Result { - let target = config_handle() - .lock() - .unwrap() - .as_ref() - .map(|conf| conf.target); - if let Some(target) = target { - get_internal(merge_configs, true, target) - } else { - crate::error::bail!("config not loaded"); - } +pub fn reload_config( + config: &mut ConfigMetadata, + merge_configs: &[&serde_json::Value], + tauri_dir: &Path, +) -> crate::Result<()> { + let target = config.target; + *config = load_config(merge_configs, true, target, tauri_dir)?; + Ok(()) } /// merges the loaded config with the given value -pub fn merge_with(merge_configs: &[&serde_json::Value]) -> crate::Result { - let handle = config_handle(); - +pub fn merge_config_with( + config: &mut ConfigMetadata, + merge_configs: &[&serde_json::Value], +) -> crate::Result<()> { if merge_configs.is_empty() { - return Ok(handle); + return Ok(()); } - if let Some(config_metadata) = &mut *handle.lock().unwrap() { - let mut merge_config = serde_json::Value::Object(Default::default()); - for conf in merge_configs { - merge_patches(&mut merge_config, conf); - } - - let merge_config_str = serde_json::to_string(&merge_config).unwrap(); - set_var("TAURI_CONFIG", merge_config_str); - - let mut value = - serde_json::to_value(config_metadata.inner.clone()).context("failed to serialize config")?; - merge(&mut value, &merge_config); - config_metadata.inner = serde_json::from_value(value).context("failed to parse config")?; - - Ok(handle) - } else { - crate::error::bail!("config not loaded"); + let mut merge_config = serde_json::Value::Object(Default::default()); + for conf in merge_configs { + merge_patches(&mut merge_config, conf); } + + let merge_config_str = serde_json::to_string(&merge_config).unwrap(); + set_var("TAURI_CONFIG", merge_config_str); + + let mut value = + serde_json::to_value(config.inner.clone()).context("failed to serialize config")?; + merge(&mut value, &merge_config); + config.inner = serde_json::from_value(value).context("failed to parse config")?; + Ok(()) } /// Same as [`json_patch::merge`] but doesn't delete the key when the patch's value is `null` diff --git a/crates/tauri-cli/src/helpers/mod.rs b/crates/tauri-cli/src/helpers/mod.rs index 06ff052ce..3d2a5f0e9 100644 --- a/crates/tauri-cli/src/helpers/mod.rs +++ b/crates/tauri-cli/src/helpers/mod.rs @@ -35,8 +35,6 @@ use crate::{ CommandExt, }; -use self::app_paths::frontend_dir; - pub fn command_env(debug: bool) -> HashMap<&'static str, String> { let mut map = HashMap::new(); @@ -78,13 +76,14 @@ pub fn run_hook( hook: HookCommand, interface: &AppInterface, debug: bool, + frontend_dir: &Path, ) -> crate::Result<()> { let (script, script_cwd) = match hook { HookCommand::Script(s) if s.is_empty() => (None, None), HookCommand::Script(s) => (Some(s), None), HookCommand::ScriptWithOptions { script, cwd } => (Some(script), cwd.map(Into::into)), }; - let cwd = script_cwd.unwrap_or_else(|| frontend_dir().clone()); + let cwd = script_cwd.unwrap_or_else(|| frontend_dir.to_owned()); if let Some(script) = script { log::info!(action = "Running"; "{} `{}`", name, script); diff --git a/crates/tauri-cli/src/icon.rs b/crates/tauri-cli/src/icon.rs index 6228dc97b..4945fb826 100644 --- a/crates/tauri-cli/src/icon.rs +++ b/crates/tauri-cli/src/icon.rs @@ -4,7 +4,6 @@ use crate::{ error::{Context, Error, ErrorExt}, - helpers::app_paths::tauri_dir, Result, }; @@ -237,8 +236,8 @@ fn parse_bg_color(bg_color_string: &String) -> Result> { pub fn command(options: Options) -> Result<()> { let input = options.input; let out_dir = options.output.unwrap_or_else(|| { - crate::helpers::app_paths::resolve(); - tauri_dir().join("icons") + let dirs = crate::helpers::app_paths::resolve_dirs(); + dirs.tauri.join("icons") }); let png_icon_sizes = options.png.unwrap_or_default(); diff --git a/crates/tauri-cli/src/info/app.rs b/crates/tauri-cli/src/info/app.rs index 624d79bd3..6814c96bd 100644 --- a/crates/tauri-cli/src/info/app.rs +++ b/crates/tauri-cli/src/info/app.rs @@ -3,56 +3,46 @@ // SPDX-License-Identifier: MIT use super::SectionItem; +use crate::helpers::config::ConfigMetadata; use crate::helpers::framework; -use std::{ - fs::read_to_string, - path::{Path, PathBuf}, -}; -use tauri_utils::platform::Target; +use std::{fs::read_to_string, path::PathBuf}; -pub fn items(frontend_dir: Option<&PathBuf>, tauri_dir: Option<&Path>) -> Vec { +pub fn items(config: &ConfigMetadata, frontend_dir: Option<&PathBuf>) -> Vec { let mut items = Vec::new(); - if tauri_dir.is_some() { - if let Ok(config) = crate::helpers::config::get(Target::current(), &[]) { - let config_guard = config.lock().unwrap(); - let config = config_guard.as_ref().unwrap(); + let bundle_or_build = if config.bundle.active { + "bundle" + } else { + "build" + }; + items.push(SectionItem::new().description(format!("build-type: {bundle_or_build}"))); - let bundle_or_build = if config.bundle.active { - "bundle" - } else { - "build" - }; - items.push(SectionItem::new().description(format!("build-type: {bundle_or_build}"))); + let csp = config + .app + .security + .csp + .clone() + .map(|c| c.to_string()) + .unwrap_or_else(|| "unset".to_string()); + items.push(SectionItem::new().description(format!("CSP: {csp}"))); - let csp = config - .app - .security - .csp - .clone() - .map(|c| c.to_string()) - .unwrap_or_else(|| "unset".to_string()); - items.push(SectionItem::new().description(format!("CSP: {csp}"))); + if let Some(frontend_dist) = &config.build.frontend_dist { + items.push(SectionItem::new().description(format!("frontendDist: {frontend_dist}"))); + } - if let Some(frontend_dist) = &config.build.frontend_dist { - items.push(SectionItem::new().description(format!("frontendDist: {frontend_dist}"))); + if let Some(dev_url) = &config.build.dev_url { + items.push(SectionItem::new().description(format!("devUrl: {dev_url}"))); + } + + if let Some(frontend_dir) = frontend_dir { + if let Ok(package_json) = read_to_string(frontend_dir.join("package.json")) { + let (framework, bundler) = framework::infer_from_package_json(&package_json); + + if let Some(framework) = framework { + items.push(SectionItem::new().description(format!("framework: {framework}"))); } - if let Some(dev_url) = &config.build.dev_url { - items.push(SectionItem::new().description(format!("devUrl: {dev_url}"))); - } - - if let Some(frontend_dir) = frontend_dir { - if let Ok(package_json) = read_to_string(frontend_dir.join("package.json")) { - let (framework, bundler) = framework::infer_from_package_json(&package_json); - - if let Some(framework) = framework { - items.push(SectionItem::new().description(format!("framework: {framework}"))); - } - - if let Some(bundler) = bundler { - items.push(SectionItem::new().description(format!("bundler: {bundler}"))); - } - } + if let Some(bundler) = bundler { + items.push(SectionItem::new().description(format!("bundler: {bundler}"))); } } } diff --git a/crates/tauri-cli/src/info/mod.rs b/crates/tauri-cli/src/info/mod.rs index 0f89d31c1..cb52415a9 100644 --- a/crates/tauri-cli/src/info/mod.rs +++ b/crates/tauri-cli/src/info/mod.rs @@ -12,6 +12,7 @@ use colored::{ColoredString, Colorize}; use dialoguer::{theme::ColorfulTheme, Confirm}; use serde::Deserialize; use std::fmt::{self, Display, Formatter}; +use tauri_utils::platform::Target; mod app; mod env_nodejs; @@ -265,11 +266,6 @@ pub fn command(options: Options) -> Result<()> { let frontend_dir = resolve_frontend_dir(); let tauri_dir = resolve_tauri_dir(); - if tauri_dir.is_some() { - // safe to initialize - crate::helpers::app_paths::resolve(); - } - let package_manager = frontend_dir .as_ref() .map(packages_nodejs::package_manager) @@ -313,9 +309,11 @@ pub fn command(options: Options) -> Result<()> { interactive, items: Vec::new(), }; - app - .items - .extend(app::items(frontend_dir.as_ref(), tauri_dir.as_deref())); + if let Some(tauri_dir) = &tauri_dir { + if let Ok(config) = crate::helpers::config::get_config(Target::current(), &[], tauri_dir) { + app.items.extend(app::items(&config, frontend_dir.as_ref())); + }; + } environment.display(); diff --git a/crates/tauri-cli/src/info/plugins.rs b/crates/tauri-cli/src/info/plugins.rs index a5080caf1..d0ede6b25 100644 --- a/crates/tauri-cli/src/info/plugins.rs +++ b/crates/tauri-cli/src/info/plugins.rs @@ -111,33 +111,27 @@ pub fn items( ) -> Vec { let mut items = Vec::new(); - if tauri_dir.is_some() || frontend_dir.is_some() { - if let Some(tauri_dir) = tauri_dir { - let (manifest, lock) = cargo_manifest_and_lock(tauri_dir); + if let Some(tauri_dir) = tauri_dir { + let (manifest, lock) = cargo_manifest_and_lock(tauri_dir); - for p in helpers::plugins::known_plugins().keys() { - let dep = format!("tauri-plugin-{p}"); - let crate_version = crate_version(tauri_dir, manifest.as_ref(), lock.as_ref(), &dep); - if !crate_version.has_version() { - continue; - } - let item = packages_rust::rust_section_item(&dep, crate_version); - items.push(item); - - let Some(frontend_dir) = frontend_dir else { - continue; - }; - - let package = format!("@tauri-apps/plugin-{p}"); - - let item = packages_nodejs::nodejs_section_item( - package, - None, - frontend_dir.clone(), - package_manager, - ); - items.push(item); + for p in helpers::plugins::known_plugins().keys() { + let dep = format!("tauri-plugin-{p}"); + let crate_version = crate_version(tauri_dir, manifest.as_ref(), lock.as_ref(), &dep); + if !crate_version.has_version() { + continue; } + let item = packages_rust::rust_section_item(&dep, crate_version); + items.push(item); + + let Some(frontend_dir) = frontend_dir else { + continue; + }; + + let package = format!("@tauri-apps/plugin-{p}"); + + let item = + packages_nodejs::nodejs_section_item(package, None, frontend_dir.clone(), package_manager); + items.push(item); } } diff --git a/crates/tauri-cli/src/inspect.rs b/crates/tauri-cli/src/inspect.rs index 68d040ed2..a2bb3bfa1 100644 --- a/crates/tauri-cli/src/inspect.rs +++ b/crates/tauri-cli/src/inspect.rs @@ -1,6 +1,7 @@ // Copyright 2019-2024 Tauri Programme within The Commons Conservancy // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT +use std::path::Path; use crate::Result; use clap::{Parser, Subcommand}; @@ -21,19 +22,18 @@ enum Commands { } pub fn command(cli: Cli) -> Result<()> { + let dirs = crate::helpers::app_paths::resolve_dirs(); match cli.command { - Commands::WixUpgradeCode => wix_upgrade_code(), + Commands::WixUpgradeCode => wix_upgrade_code(dirs.tauri), } } // NOTE: if this is ever changed, make sure to also update Wix upgrade code generation in tauri-bundler -fn wix_upgrade_code() -> Result<()> { - crate::helpers::app_paths::resolve(); - +fn wix_upgrade_code(tauri_dir: &Path) -> Result<()> { let target = tauri_utils::platform::Target::Windows; - let config = crate::helpers::config::get(target, &[])?; + let config = crate::helpers::config::get_config(target, &[], tauri_dir)?; - let interface = AppInterface::new(config.lock().unwrap().as_ref().unwrap(), None)?; + let interface = AppInterface::new(&config, None, tauri_dir)?; let product_name = interface.app_settings().get_package_settings().product_name; @@ -44,13 +44,13 @@ fn wix_upgrade_code() -> Result<()> { .to_string(); log::info!("Default WiX Upgrade Code, derived from {product_name}: {upgrade_code}"); - if let Some(code) = config.lock().unwrap().as_ref().and_then(|c| { - c.bundle - .windows - .wix - .as_ref() - .and_then(|wix| wix.upgrade_code) - }) { + if let Some(code) = config + .bundle + .windows + .wix + .as_ref() + .and_then(|wix| wix.upgrade_code) + { log::info!("Application Upgrade Code override: {code}"); } diff --git a/crates/tauri-cli/src/interface/mod.rs b/crates/tauri-cli/src/interface/mod.rs index b153b33bf..8b797091d 100644 --- a/crates/tauri-cli/src/interface/mod.rs +++ b/crates/tauri-cli/src/interface/mod.rs @@ -9,9 +9,13 @@ use std::{ path::{Path, PathBuf}, process::ExitStatus, sync::Arc, + sync::Mutex, }; -use crate::{error::Context, helpers::config::Config}; +use crate::{ + error::Context, helpers::app_paths::Dirs, helpers::config::Config, + helpers::config::ConfigMetadata, +}; use tauri_bundler::bundle::{PackageType, Settings, SettingsBuilder}; pub use rust::{MobileOptions, Options, Rust as AppInterface, WatcherOptions}; @@ -32,9 +36,14 @@ pub trait AppSettings { options: &Options, config: &Config, features: &[String], + tauri_dir: &Path, ) -> crate::Result; - fn app_binary_path(&self, options: &Options) -> crate::Result; - fn get_binaries(&self, options: &Options) -> crate::Result>; + fn app_binary_path(&self, options: &Options, tauri_dir: &Path) -> crate::Result; + fn get_binaries( + &self, + options: &Options, + tauri_dir: &Path, + ) -> crate::Result>; fn app_name(&self) -> Option; fn lib_name(&self) -> Option; @@ -44,6 +53,7 @@ pub trait AppSettings { config: &Config, out_dir: &Path, package_types: Vec, + tauri_dir: &Path, ) -> crate::Result { let no_default_features = options.args.contains(&"--no-default-features".into()); let mut enabled_features = options.features.clone(); @@ -57,7 +67,7 @@ pub trait AppSettings { tauri_utils::platform::target_triple().context("failed to get target triple")? }; - let mut bins = self.get_binaries(&options)?; + let mut bins = self.get_binaries(&options, tauri_dir)?; if let Some(main_binary_name) = &config.main_binary_name { let main = bins.iter_mut().find(|b| b.main()).context("no main bin?")?; main.set_name(main_binary_name.to_owned()); @@ -65,7 +75,7 @@ pub trait AppSettings { let mut settings_builder = SettingsBuilder::new() .package_settings(self.get_package_settings()) - .bundle_settings(self.get_bundle_settings(&options, config, &enabled_features)?) + .bundle_settings(self.get_bundle_settings(&options, config, &enabled_features, tauri_dir)?) .binaries(bins) .project_out_directory(out_dir) .target(target) @@ -73,7 +83,7 @@ pub trait AppSettings { if config.bundle.use_local_tools_dir { settings_builder = settings_builder.local_tools_directory( - rust::get_cargo_metadata() + rust::get_cargo_metadata(tauri_dir) .context("failed to get cargo metadata")? .target_directory, ) @@ -99,23 +109,29 @@ pub enum ExitReason { pub trait Interface: Sized { type AppSettings: AppSettings; - fn new(config: &Config, target: Option) -> crate::Result; + fn new(config: &Config, target: Option, tauri_dir: &Path) -> crate::Result; fn app_settings(&self) -> Arc; fn env(&self) -> HashMap<&str, String>; - fn build(&mut self, options: Options) -> crate::Result; + fn build(&mut self, options: Options, dirs: &Dirs) -> crate::Result; fn dev, ExitReason) + Send + Sync + 'static>( &mut self, + config: &Mutex, options: Options, on_exit: F, + dirs: &Dirs, ) -> crate::Result<()>; fn mobile_dev crate::Result>>( &mut self, + config: &Mutex, options: MobileOptions, runner: R, + dirs: &Dirs, ) -> crate::Result<()>; fn watch crate::Result>>( &mut self, + config: &Mutex, options: WatcherOptions, runner: R, + dirs: &Dirs, ) -> crate::Result<()>; } diff --git a/crates/tauri-cli/src/interface/rust.rs b/crates/tauri-cli/src/interface/rust.rs index 6f303c732..a9a42363a 100644 --- a/crates/tauri-cli/src/interface/rust.rs +++ b/crates/tauri-cli/src/interface/rust.rs @@ -31,8 +31,8 @@ use super::{AppSettings, DevProcess, ExitReason, Interface}; use crate::{ error::{Context, Error, ErrorExt}, helpers::{ - app_paths::{frontend_dir, tauri_dir}, - config::{nsis_settings, reload as reload_config, wix_settings, BundleResources, Config}, + app_paths::Dirs, + config::{nsis_settings, reload_config, wix_settings, BundleResources, Config, ConfigMetadata}, }, ConfigValue, }; @@ -137,7 +137,7 @@ pub struct Rust { impl Interface for Rust { type AppSettings = RustAppSettings; - fn new(config: &Config, target: Option) -> crate::Result { + fn new(config: &Config, target: Option, tauri_dir: &Path) -> crate::Result { let manifest = { let (tx, rx) = sync_channel(1); let mut watcher = new_debouncer(Duration::from_secs(1), None, move |r| { @@ -147,14 +147,9 @@ impl Interface for Rust { }) .unwrap(); watcher - .watch(tauri_dir().join("Cargo.toml"), RecursiveMode::NonRecursive) - .with_context(|| { - format!( - "failed to watch {}", - tauri_dir().join("Cargo.toml").display() - ) - })?; - let (manifest, modified) = rewrite_manifest(config)?; + .watch(tauri_dir.join("Cargo.toml"), RecursiveMode::NonRecursive) + .with_context(|| format!("failed to watch {}", tauri_dir.join("Cargo.toml").display()))?; + let (manifest, modified) = rewrite_manifest(config, tauri_dir)?; if modified { // Wait for the modified event so we don't trigger a re-build later on let _ = rx.recv_timeout(Duration::from_secs(2)); @@ -172,7 +167,7 @@ impl Interface for Rust { ); } - let app_settings = RustAppSettings::new(config, manifest, target)?; + let app_settings = RustAppSettings::new(config, manifest, target, tauri_dir)?; Ok(Self { app_settings: Arc::new(app_settings), @@ -186,20 +181,23 @@ impl Interface for Rust { self.app_settings.clone() } - fn build(&mut self, options: Options) -> crate::Result { + fn build(&mut self, options: Options, dirs: &Dirs) -> crate::Result { desktop::build( options, &self.app_settings, &mut self.available_targets, self.config_features.clone(), self.main_binary_name.as_deref(), + dirs.tauri, ) } fn dev, ExitReason) + Send + Sync + 'static>( &mut self, + config: &Mutex, mut options: Options, on_exit: F, + dirs: &Dirs, ) -> crate::Result<()> { let on_exit = Arc::new(on_exit); @@ -229,14 +227,22 @@ impl Interface for Rust { on_exit(status, reason) }) }); - self.run_dev_watcher(&options.additional_watch_folders, &merge_configs, run) + self.run_dev_watcher( + config, + &options.additional_watch_folders, + &merge_configs, + run, + dirs, + ) } } fn mobile_dev crate::Result>>( &mut self, + config: &Mutex, mut options: MobileOptions, runner: R, + dirs: &Dirs, ) -> crate::Result<()> { let mut run_args = Vec::new(); dev_options( @@ -252,23 +258,33 @@ impl Interface for Rust { Ok(()) } else { self.watch( + config, WatcherOptions { config: options.config.clone(), additional_watch_folders: options.additional_watch_folders.clone(), }, move || runner(options.clone()), + dirs, ) } } fn watch crate::Result>>( &mut self, + config: &Mutex, options: WatcherOptions, runner: R, + dirs: &Dirs, ) -> crate::Result<()> { let merge_configs = options.config.iter().map(|c| &c.0).collect::>(); let run = Arc::new(|_rust: &mut Rust| runner()); - self.run_dev_watcher(&options.additional_watch_folders, &merge_configs, run) + self.run_dev_watcher( + config, + &options.additional_watch_folders, + &merge_configs, + run, + dirs, + ) } fn env(&self) -> HashMap<&str, String> { @@ -443,19 +459,21 @@ fn expand_member_path(path: &Path) -> crate::Result> { Ok(res) } -fn get_watch_folders(additional_watch_folders: &[PathBuf]) -> crate::Result> { - let tauri_path = tauri_dir(); - let workspace_path = get_workspace_dir()?; +fn get_watch_folders( + additional_watch_folders: &[PathBuf], + tauri_dir: &Path, +) -> crate::Result> { + let workspace_path = get_workspace_dir(tauri_dir)?; // We always want to watch the main tauri folder. - let mut watch_folders = vec![tauri_path.to_path_buf()]; + let mut watch_folders = vec![tauri_dir.to_path_buf()]; // Add the additional watch folders, resolving the path from the tauri path if it is relative watch_folders.extend(additional_watch_folders.iter().filter_map(|dir| { let path = if dir.is_absolute() { dir.to_owned() } else { - tauri_path.join(dir) + tauri_dir.join(dir) }; let canonicalized = canonicalize(&path).ok(); @@ -523,17 +541,18 @@ impl Rust { fn run_dev_watcher crate::Result>>( &mut self, + config: &Mutex, additional_watch_folders: &[PathBuf], merge_configs: &[&serde_json::Value], run: Arc, + dirs: &Dirs, ) -> crate::Result<()> { let child = run(self)?; let process = Arc::new(Mutex::new(child)); let (tx, rx) = sync_channel(1); - let frontend_path = frontend_dir(); - let watch_folders = get_watch_folders(additional_watch_folders)?; + let watch_folders = get_watch_folders(additional_watch_folders, dirs.tauri)?; let common_ancestor = common_path::common_path_all(watch_folders.iter().map(Path::new)) .expect("watch_folders should not be empty"); @@ -573,22 +592,21 @@ impl Rust { if let Some(event_path) = event.paths.first() { if !ignore_matcher.is_ignore(event_path, event_path.is_dir()) { - if is_configuration_file(self.app_settings.target_platform, event_path) { - if let Ok(config) = reload_config(merge_configs) { - let (manifest, modified) = - rewrite_manifest(config.lock().unwrap().as_ref().unwrap())?; - if modified { - *self.app_settings.manifest.lock().unwrap() = manifest; - // no need to run the watcher logic, the manifest was modified - // and it will trigger the watcher again - continue; - } + if is_configuration_file(self.app_settings.target_platform, event_path) + && reload_config(&mut config.lock().unwrap(), merge_configs, dirs.tauri).is_ok() + { + let (manifest, modified) = rewrite_manifest(&config.lock().unwrap(), dirs.tauri)?; + if modified { + *self.app_settings.manifest.lock().unwrap() = manifest; + // no need to run the watcher logic, the manifest was modified + // and it will trigger the watcher again + continue; } } log::info!( "File {} changed. Rebuilding application...", - display_path(event_path.strip_prefix(frontend_path).unwrap_or(event_path)) + display_path(event_path.strip_prefix(dirs.frontend).unwrap_or(event_path)) ); let mut p = process.lock().unwrap(); @@ -837,6 +855,7 @@ impl AppSettings for RustAppSettings { options: &Options, config: &Config, features: &[String], + tauri_dir: &Path, ) -> crate::Result { let arch64bits = self.target_triple.starts_with("x86_64") || self.target_triple.starts_with("aarch64") @@ -867,6 +886,7 @@ impl AppSettings for RustAppSettings { self, features, config, + tauri_dir, config.bundle.clone(), updater_settings, arch64bits, @@ -911,8 +931,8 @@ impl AppSettings for RustAppSettings { Ok(settings) } - fn app_binary_path(&self, options: &Options) -> crate::Result { - let binaries = self.get_binaries(options)?; + fn app_binary_path(&self, options: &Options, tauri_dir: &Path) -> crate::Result { + let binaries = self.get_binaries(options, tauri_dir)?; let bin_name = binaries .iter() .find(|x| x.main()) @@ -920,7 +940,7 @@ impl AppSettings for RustAppSettings { .name(); let out_dir = self - .out_dir(options) + .out_dir(options, tauri_dir) .context("failed to get project out directory")?; let mut path = out_dir.join(bin_name); @@ -938,7 +958,7 @@ impl AppSettings for RustAppSettings { Ok(path) } - fn get_binaries(&self, options: &Options) -> crate::Result> { + fn get_binaries(&self, options: &Options, tauri_dir: &Path) -> crate::Result> { let mut binaries = Vec::new(); if let Some(bins) = &self.cargo_settings.bin { @@ -967,8 +987,6 @@ impl AppSettings for RustAppSettings { } } - let tauri_dir = tauri_dir(); - let mut binaries_paths = std::fs::read_dir(tauri_dir.join("src/bin")) .map(|dir| { dir @@ -1060,8 +1078,12 @@ impl AppSettings for RustAppSettings { } impl RustAppSettings { - pub fn new(config: &Config, manifest: Manifest, target: Option) -> crate::Result { - let tauri_dir = tauri_dir(); + pub fn new( + config: &Config, + manifest: Manifest, + target: Option, + tauri_dir: &Path, + ) -> crate::Result { let cargo_settings = CargoSettings::load(tauri_dir).context("failed to load Cargo settings")?; let cargo_package_settings = match &cargo_settings.package { Some(package_info) => package_info.clone(), @@ -1072,7 +1094,7 @@ impl RustAppSettings { } }; - let ws_package_settings = CargoSettings::load(&get_workspace_dir()?) + let ws_package_settings = CargoSettings::load(&get_workspace_dir(tauri_dir)?) .context("failed to load Cargo settings from workspace root")? .workspace .and_then(|v| v.package); @@ -1177,8 +1199,8 @@ impl RustAppSettings { .or_else(|| self.cargo_config.build().target()) } - pub fn out_dir(&self, options: &Options) -> crate::Result { - get_target_dir(self.target(options), options) + pub fn out_dir(&self, options: &Options, tauri_dir: &Path) -> crate::Result { + get_target_dir(self.target(options), options, tauri_dir) } } @@ -1188,10 +1210,10 @@ pub(crate) struct CargoMetadata { pub(crate) workspace_root: PathBuf, } -pub(crate) fn get_cargo_metadata() -> crate::Result { +pub(crate) fn get_cargo_metadata(tauri_dir: &Path) -> crate::Result { let output = Command::new("cargo") .args(["metadata", "--no-deps", "--format-version", "1"]) - .current_dir(tauri_dir()) + .current_dir(tauri_dir) .output() .map_err(|error| Error::CommandFailed { command: "cargo metadata --no-deps --format-version 1".to_string(), @@ -1211,13 +1233,13 @@ pub(crate) fn get_cargo_metadata() -> crate::Result { /// Get the cargo target directory based on the provided arguments. /// If "--target-dir" is specified in args, use it as the target directory (relative to current directory). /// Otherwise, use the target directory from cargo metadata. -pub(crate) fn get_cargo_target_dir(args: &[String]) -> crate::Result { +pub(crate) fn get_cargo_target_dir(args: &[String], tauri_dir: &Path) -> crate::Result { let path = if let Some(target) = get_cargo_option(args, "--target-dir") { std::env::current_dir() .context("failed to get current directory")? .join(target) } else { - get_cargo_metadata() + get_cargo_metadata(tauri_dir) .context("failed to run 'cargo metadata' command to get target directory")? .target_directory }; @@ -1227,8 +1249,12 @@ pub(crate) fn get_cargo_target_dir(args: &[String]) -> crate::Result { /// This function determines the 'target' directory and suffixes it with the profile /// to determine where the compiled binary will be located. -fn get_target_dir(triple: Option<&str>, options: &Options) -> crate::Result { - let mut path = get_cargo_target_dir(&options.args)?; +fn get_target_dir( + triple: Option<&str>, + options: &Options, + tauri_dir: &Path, +) -> crate::Result { + let mut path = get_cargo_target_dir(&options.args, tauri_dir)?; if let Some(triple) = triple { path.push(triple); @@ -1253,9 +1279,9 @@ fn get_cargo_option<'a>(args: &'a [String], option: &'a str) -> Option<&'a str> } /// Executes `cargo metadata` to get the workspace directory. -pub fn get_workspace_dir() -> crate::Result { +pub fn get_workspace_dir(tauri_dir: &Path) -> crate::Result { Ok( - get_cargo_metadata() + get_cargo_metadata(tauri_dir) .context("failed to run 'cargo metadata' command to get workspace directory")? .workspace_root, ) @@ -1281,6 +1307,7 @@ fn tauri_config_to_bundle_settings( settings: &RustAppSettings, features: &[String], tauri_config: &Config, + tauri_dir: &Path, config: crate::helpers::config::BundleConfig, updater_config: Option, arch64bits: bool, @@ -1562,7 +1589,7 @@ fn tauri_config_to_bundle_settings( info_plist: { let mut src_plists = vec![]; - let path = tauri_dir().join("Info.plist"); + let path = tauri_dir.join("Info.plist"); if path.exists() { src_plists.push(path.into()); } @@ -1604,7 +1631,7 @@ fn tauri_config_to_bundle_settings( .unwrap() }) }), - license_file: config.license_file.map(|l| tauri_dir().join(l)), + license_file: config.license_file.map(|l| tauri_dir.join(l)), updater: updater_config, ..Default::default() }) @@ -1741,7 +1768,7 @@ mod tests { #[test] fn parse_target_dir_from_opts() { - crate::helpers::app_paths::resolve(); + let dirs = crate::helpers::app_paths::resolve_dirs(); let current_dir = std::env::current_dir().unwrap(); let options = Options { @@ -1758,11 +1785,11 @@ mod tests { }; assert_eq!( - get_target_dir(None, &options).unwrap(), + get_target_dir(None, &options, dirs.tauri).unwrap(), current_dir.join("path/to/some/dir/release") ); assert_eq!( - get_target_dir(Some("x86_64-pc-windows-msvc"), &options).unwrap(), + get_target_dir(Some("x86_64-pc-windows-msvc"), &options, dirs.tauri).unwrap(), current_dir .join("path/to/some/dir") .join("x86_64-pc-windows-msvc") @@ -1781,23 +1808,27 @@ mod tests { }; #[cfg(windows)] - assert!(get_target_dir(Some("x86_64-pc-windows-msvc"), &options) - .unwrap() - .ends_with("x86_64-pc-windows-msvc\\release")); + assert!( + get_target_dir(Some("x86_64-pc-windows-msvc"), &options, dirs.tauri) + .unwrap() + .ends_with("x86_64-pc-windows-msvc\\release") + ); #[cfg(not(windows))] - assert!(get_target_dir(Some("x86_64-pc-windows-msvc"), &options) - .unwrap() - .ends_with("x86_64-pc-windows-msvc/release")); + assert!( + get_target_dir(Some("x86_64-pc-windows-msvc"), &options, dirs.tauri) + .unwrap() + .ends_with("x86_64-pc-windows-msvc/release") + ); #[cfg(windows)] { std::env::set_var("CARGO_TARGET_DIR", "D:\\path\\to\\env\\dir"); assert_eq!( - get_target_dir(None, &options).unwrap(), + get_target_dir(None, &options, dirs.tauri).unwrap(), PathBuf::from("D:\\path\\to\\env\\dir\\release") ); assert_eq!( - get_target_dir(Some("x86_64-pc-windows-msvc"), &options).unwrap(), + get_target_dir(Some("x86_64-pc-windows-msvc"), &options, dirs.tauri).unwrap(), PathBuf::from("D:\\path\\to\\env\\dir\\x86_64-pc-windows-msvc\\release") ); } @@ -1806,11 +1837,11 @@ mod tests { { std::env::set_var("CARGO_TARGET_DIR", "/path/to/env/dir"); assert_eq!( - get_target_dir(None, &options).unwrap(), + get_target_dir(None, &options, dirs.tauri).unwrap(), PathBuf::from("/path/to/env/dir/release") ); assert_eq!( - get_target_dir(Some("x86_64-pc-windows-msvc"), &options).unwrap(), + get_target_dir(Some("x86_64-pc-windows-msvc"), &options, dirs.tauri).unwrap(), PathBuf::from("/path/to/env/dir/x86_64-pc-windows-msvc/release") ); } diff --git a/crates/tauri-cli/src/interface/rust/desktop.rs b/crates/tauri-cli/src/interface/rust/desktop.rs index b372dc015..15cd503e6 100644 --- a/crates/tauri-cli/src/interface/rust/desktop.rs +++ b/crates/tauri-cli/src/interface/rust/desktop.rs @@ -12,7 +12,7 @@ use shared_child::SharedChild; use std::{ fs, io::{BufReader, ErrorKind, Write}, - path::PathBuf, + path::{Path, PathBuf}, process::{Command, ExitStatus, Stdio}, sync::{ atomic::{AtomicBool, Ordering}, @@ -158,9 +158,10 @@ pub fn build( available_targets: &mut Option>, config_features: Vec, main_binary_name: Option<&str>, + tauri_dir: &Path, ) -> crate::Result { - let out_dir = app_settings.out_dir(&options)?; - let bin_path = app_settings.app_binary_path(&options)?; + let out_dir = app_settings.out_dir(&options, tauri_dir)?; + let bin_path = app_settings.app_binary_path(&options, tauri_dir)?; if !std::env::var("STATIC_VCRUNTIME").is_ok_and(|v| v == "false") { std::env::set_var("STATIC_VCRUNTIME", "true"); @@ -182,7 +183,7 @@ pub fn build( options.target.replace(triple.into()); let triple_out_dir = app_settings - .out_dir(&options) + .out_dir(&options, tauri_dir) .with_context(|| format!("failed to get {triple} out dir"))?; build_production_app(options, available_targets, config_features.clone()) diff --git a/crates/tauri-cli/src/interface/rust/manifest.rs b/crates/tauri-cli/src/interface/rust/manifest.rs index 03e9768bd..58a5dd6c1 100644 --- a/crates/tauri-cli/src/interface/rust/manifest.rs +++ b/crates/tauri-cli/src/interface/rust/manifest.rs @@ -4,10 +4,7 @@ use crate::{ error::{Context, ErrorExt}, - helpers::{ - app_paths::tauri_dir, - config::{Config, PatternKind}, - }, + helpers::config::{Config, PatternKind}, }; use itertools::Itertools; @@ -272,8 +269,8 @@ fn inject_features( Ok(persist) } -pub fn rewrite_manifest(config: &Config) -> crate::Result<(Manifest, bool)> { - let manifest_path = tauri_dir().join("Cargo.toml"); +pub fn rewrite_manifest(config: &Config, tauri_dir: &Path) -> crate::Result<(Manifest, bool)> { + let manifest_path = tauri_dir.join("Cargo.toml"); let (mut manifest, original_manifest_str) = read_manifest(&manifest_path)?; let mut dependencies = Vec::new(); diff --git a/crates/tauri-cli/src/migrate/migrations/v1/mod.rs b/crates/tauri-cli/src/migrate/migrations/v1/mod.rs index 14a9cd7c4..6372db7b5 100644 --- a/crates/tauri-cli/src/migrate/migrations/v1/mod.rs +++ b/crates/tauri-cli/src/migrate/migrations/v1/mod.rs @@ -2,35 +2,31 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use crate::{ - error::Context, - helpers::app_paths::{frontend_dir, tauri_dir}, - Result, -}; +use crate::{error::Context, helpers::app_paths::Dirs, Result}; mod config; mod frontend; mod manifest; -pub fn run() -> Result<()> { - let tauri_dir = tauri_dir(); - let frontend_dir = frontend_dir(); - - let mut migrated = config::migrate(tauri_dir).context("Could not migrate config")?; - manifest::migrate(tauri_dir).context("Could not migrate manifest")?; - let plugins = frontend::migrate(frontend_dir)?; +pub fn run(dirs: &Dirs) -> Result<()> { + let mut migrated = config::migrate(dirs.tauri).context("Could not migrate config")?; + manifest::migrate(dirs.tauri).context("Could not migrate manifest")?; + let plugins = frontend::migrate(dirs.frontend)?; migrated.plugins.extend(plugins); // Add plugins for plugin in migrated.plugins { - crate::add::run(crate::add::Options { - plugin: plugin.clone(), - branch: None, - tag: None, - rev: None, - no_fmt: false, - }) + crate::add::run( + crate::add::Options { + plugin: plugin.clone(), + branch: None, + tag: None, + rev: None, + no_fmt: false, + }, + dirs, + ) .with_context(|| format!("Could not migrate plugin '{plugin}'"))?; } diff --git a/crates/tauri-cli/src/migrate/migrations/v2_beta.rs b/crates/tauri-cli/src/migrate/migrations/v2_beta.rs index aad493670..dcb6e52c2 100644 --- a/crates/tauri-cli/src/migrate/migrations/v2_beta.rs +++ b/crates/tauri-cli/src/migrate/migrations/v2_beta.rs @@ -4,10 +4,7 @@ use crate::{ error::{Context, ErrorExt}, - helpers::{ - app_paths::{frontend_dir, tauri_dir}, - npm::PackageManager, - }, + helpers::{app_paths::Dirs, npm::PackageManager}, interface::rust::manifest::{read_manifest, serialize_manifest}, Result, }; @@ -16,17 +13,14 @@ use std::{fs::read_to_string, path::Path}; use toml_edit::{DocumentMut, Item, Table, TableLike, Value}; -pub fn run() -> Result<()> { - let frontend_dir = frontend_dir(); - let tauri_dir = tauri_dir(); - - let manifest_path = tauri_dir.join("Cargo.toml"); +pub fn run(dirs: &Dirs) -> Result<()> { + let manifest_path = dirs.tauri.join("Cargo.toml"); let (mut manifest, _) = read_manifest(&manifest_path)?; migrate_manifest(&mut manifest)?; - migrate_permissions(tauri_dir)?; + migrate_permissions(dirs.tauri)?; - migrate_npm_dependencies(frontend_dir)?; + migrate_npm_dependencies(dirs.frontend)?; std::fs::write(&manifest_path, serialize_manifest(&manifest)) .fs_context("failed to rewrite Cargo manifest", &manifest_path)?; diff --git a/crates/tauri-cli/src/migrate/mod.rs b/crates/tauri-cli/src/migrate/mod.rs index 575a2516b..9a75089b0 100644 --- a/crates/tauri-cli/src/migrate/mod.rs +++ b/crates/tauri-cli/src/migrate/mod.rs @@ -4,10 +4,7 @@ use crate::{ error::{bail, Context, ErrorExt}, - helpers::{ - app_paths::tauri_dir, - cargo_manifest::{crate_version, CargoLock, CargoManifest}, - }, + helpers::cargo_manifest::{crate_version, CargoLock, CargoManifest}, interface::rust::get_workspace_dir, Result, }; @@ -17,22 +14,20 @@ use std::{fs::read_to_string, str::FromStr}; mod migrations; pub fn command() -> Result<()> { - crate::helpers::app_paths::resolve(); + let dirs = crate::helpers::app_paths::resolve_dirs(); - let tauri_dir = tauri_dir(); - - let manifest_contents = read_to_string(tauri_dir.join("Cargo.toml")).fs_context( + let manifest_contents = read_to_string(dirs.tauri.join("Cargo.toml")).fs_context( "failed to read Cargo manifest", - tauri_dir.join("Cargo.toml"), + dirs.tauri.join("Cargo.toml"), )?; let manifest = toml::from_str::(&manifest_contents).with_context(|| { format!( "failed to parse Cargo manifest {}", - tauri_dir.join("Cargo.toml").display() + dirs.tauri.join("Cargo.toml").display() ) })?; - let workspace_dir = get_workspace_dir()?; + let workspace_dir = get_workspace_dir(dirs.tauri)?; let lock_path = workspace_dir.join("Cargo.lock"); let lock = if lock_path.exists() { let lockfile_contents = @@ -44,19 +39,19 @@ pub fn command() -> Result<()> { None }; - let tauri_version = crate_version(tauri_dir, Some(&manifest), lock.as_ref(), "tauri") + let tauri_version = crate_version(dirs.tauri, Some(&manifest), lock.as_ref(), "tauri") .version .context("failed to get tauri version")?; let tauri_version = semver::Version::from_str(&tauri_version) .with_context(|| format!("failed to parse tauri version {tauri_version}"))?; if tauri_version.major == 1 { - migrations::v1::run().context("failed to migrate from v1")?; + migrations::v1::run(&dirs).context("failed to migrate from v1")?; } else if tauri_version.major == 2 { if let Some((pre, _number)) = tauri_version.pre.as_str().split_once('.') { match pre { "beta" => { - migrations::v2_beta::run().context("failed to migrate from v2 beta")?; + migrations::v2_beta::run(&dirs).context("failed to migrate from v2 beta")?; } "alpha" => { bail!( diff --git a/crates/tauri-cli/src/mobile/android/android_studio_script.rs b/crates/tauri-cli/src/mobile/android/android_studio_script.rs index 4657ac673..ce1d6ba8e 100644 --- a/crates/tauri-cli/src/mobile/android/android_studio_script.rs +++ b/crates/tauri-cli/src/mobile/android/android_studio_script.rs @@ -5,7 +5,7 @@ use super::{detect_target_ok, ensure_init, env, get_app, get_config, read_options, MobileTarget}; use crate::{ error::{Context, ErrorExt}, - helpers::config::{get as get_tauri_config, reload as reload_tauri_config}, + helpers::config::{get_config as get_tauri_config, reload_config as reload_tauri_config}, interface::{AppInterface, Interface}, mobile::CliOptions, Error, Result, @@ -38,7 +38,7 @@ pub struct Options { } pub fn command(options: Options) -> Result<()> { - crate::helpers::app_paths::resolve(); + let dirs = crate::helpers::app_paths::resolve_dirs(); let profile = if options.release { Profile::Release @@ -46,40 +46,31 @@ pub fn command(options: Options) -> Result<()> { Profile::Debug }; - let (tauri_config, cli_options) = { - let tauri_config = get_tauri_config(tauri_utils::platform::Target::Android, &[])?; - let cli_options = { - let tauri_config_guard = tauri_config.lock().unwrap(); - let tauri_config_ = tauri_config_guard.as_ref().unwrap(); - read_options(tauri_config_) - }; + let mut tauri_config = get_tauri_config(tauri_utils::platform::Target::Android, &[], dirs.tauri)?; + let cli_options = read_options(&tauri_config); - let tauri_config = if cli_options.config.is_empty() { - tauri_config - } else { - // reload config with merges from the android dev|build script - reload_tauri_config( - &cli_options - .config - .iter() - .map(|conf| &conf.0) - .collect::>(), - )? - }; - - (tauri_config, cli_options) + if !cli_options.config.is_empty() { + // reload config with merges from the android dev|build script + reload_tauri_config( + &mut tauri_config, + &cli_options + .config + .iter() + .map(|conf| &conf.0) + .collect::>(), + dirs.tauri, + )? }; let (config, metadata) = { - let tauri_config_guard = tauri_config.lock().unwrap(); - let tauri_config_ = tauri_config_guard.as_ref().unwrap(); let (config, metadata) = get_config( &get_app( MobileTarget::Android, - tauri_config_, - &AppInterface::new(tauri_config_, None)?, + &tauri_config, + &AppInterface::new(&tauri_config, None, dirs.tauri)?, + dirs.tauri, ), - tauri_config_, + &tauri_config, &[], &cli_options, ); @@ -95,7 +86,8 @@ pub fn command(options: Options) -> Result<()> { )?; if !cli_options.config.is_empty() { - crate::helpers::config::merge_with( + crate::helpers::config::merge_config_with( + &mut tauri_config, &cli_options .config .iter() @@ -107,16 +99,7 @@ pub fn command(options: Options) -> Result<()> { let env = env(std::env::var("CI").is_ok())?; if cli_options.dev { - let dev_url = tauri_config - .lock() - .unwrap() - .as_ref() - .unwrap() - .build - .dev_url - .clone(); - - if let Some(url) = dev_url { + if let Some(url) = &tauri_config.build.dev_url { let localhost = match url.host() { Some(url::Host::Domain(d)) => d == "localhost", Some(url::Host::Ipv4(i)) => i == std::net::Ipv4Addr::LOCALHOST, diff --git a/crates/tauri-cli/src/mobile/android/build.rs b/crates/tauri-cli/src/mobile/android/build.rs index c91ba73c1..dee966a1f 100644 --- a/crates/tauri-cli/src/mobile/android/build.rs +++ b/crates/tauri-cli/src/mobile/android/build.rs @@ -10,8 +10,8 @@ use crate::{ build::Options as BuildOptions, error::Context, helpers::{ - app_paths::tauri_dir, - config::{get as get_tauri_config, ConfigHandle}, + app_paths::Dirs, + config::{get_config as get_tauri_config, ConfigMetadata}, flock, }, interface::{AppInterface, Interface, Options as InterfaceOptions}, @@ -27,6 +27,8 @@ use cargo_mobile2::{ }; use std::env::set_current_dir; +use std::path::Path; +use std::sync::Mutex; #[derive(Debug, Clone, Parser)] #[clap( @@ -116,8 +118,25 @@ pub struct BuiltApplication { } pub fn command(options: Options, noise_level: NoiseLevel) -> Result { - crate::helpers::app_paths::resolve(); + let dirs = crate::helpers::app_paths::resolve_dirs(); + let tauri_config = Mutex::new(get_tauri_config( + tauri_utils::platform::Target::Android, + &options + .config + .iter() + .map(|conf| &conf.0) + .collect::>(), + dirs.tauri, + )?); + run(options, noise_level, &dirs, &tauri_config) +} +pub fn run( + options: Options, + noise_level: NoiseLevel, + dirs: &Dirs, + tauri_config: &Mutex, +) -> Result { delete_codegen_vars(); let mut build_options: BuildOptions = options.clone().into(); @@ -132,26 +151,16 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result>(), - )?; let (interface, config, metadata) = { - let tauri_config_guard = tauri_config.lock().unwrap(); - let tauri_config_ = tauri_config_guard.as_ref().unwrap(); - - let interface = AppInterface::new(tauri_config_, build_options.target.clone())?; + let interface = AppInterface::new(tauri_config, build_options.target.clone(), dirs.tauri)?; interface.build_options(&mut Vec::new(), &mut build_options.features, true); - let app = get_app(MobileTarget::Android, tauri_config_, &interface); + let app = get_app(MobileTarget::Android, tauri_config, &interface, dirs.tauri); let (config, metadata) = get_config( &app, - tauri_config_, + tauri_config, &build_options.features, &Default::default(), ); @@ -164,11 +173,10 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result Result Result Result { if !(options.apk.is_some() || options.aab.is_some()) { // if the user didn't specify the format to build, we'll do both @@ -257,7 +258,7 @@ fn run_build( }; let app_settings = interface.app_settings(); - let out_dir = app_settings.out_dir(&interface_options)?; + let out_dir = app_settings.out_dir(&interface_options, tauri_dir)?; let _lock = flock::open_rw(out_dir.join("lock").with_extension("android"), "Android")?; let cli_options = CliOptions { @@ -269,9 +270,9 @@ fn run_build( config: build_options.config, target_device: options.target_device.clone(), }; - let handle = write_options(tauri_config.lock().unwrap().as_ref().unwrap(), cli_options)?; + let handle = write_options(tauri_config, cli_options)?; - inject_resources(config, tauri_config.lock().unwrap().as_ref().unwrap())?; + inject_resources(config, tauri_config)?; let apk_outputs = if options.apk.unwrap_or_default() { apk::build( diff --git a/crates/tauri-cli/src/mobile/android/dev.rs b/crates/tauri-cli/src/mobile/android/dev.rs index 5dbaf8778..bb4624980 100644 --- a/crates/tauri-cli/src/mobile/android/dev.rs +++ b/crates/tauri-cli/src/mobile/android/dev.rs @@ -10,8 +10,8 @@ use crate::{ dev::Options as DevOptions, error::{Context, ErrorExt}, helpers::{ - app_paths::tauri_dir, - config::{get as get_tauri_config, ConfigHandle}, + app_paths::Dirs, + config::{get_config as get_tauri_config, ConfigMetadata}, flock, }, interface::{AppInterface, Interface, MobileOptions, Options as InterfaceOptions}, @@ -35,6 +35,7 @@ use cargo_mobile2::{ }; use url::Host; +use std::sync::Mutex; use std::{env::set_current_dir, net::Ipv4Addr, path::PathBuf}; #[derive(Debug, Clone, Parser)] @@ -131,16 +132,16 @@ impl From for DevOptions { } pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> { - crate::helpers::app_paths::resolve(); + let dirs = crate::helpers::app_paths::resolve_dirs(); - let result = run_command(options, noise_level); + let result = run_command(options, noise_level, dirs); if result.is_err() { crate::dev::kill_before_dev_process(); } result } -fn run_command(options: Options, noise_level: NoiseLevel) -> Result<()> { +fn run_command(options: Options, noise_level: NoiseLevel, dirs: Dirs) -> Result<()> { delete_codegen_vars(); // setup env additions before calling env() if let Some(root_certificate_path) = &options.root_certificate_path { @@ -160,6 +161,7 @@ fn run_command(options: Options, noise_level: NoiseLevel) -> Result<()> { .iter() .map(|conf| &conf.0) .collect::>(), + dirs.tauri, )?; let env = env(false)?; @@ -183,23 +185,19 @@ fn run_command(options: Options, noise_level: NoiseLevel) -> Result<()> { dev_options.target = Some(target_triple); let (interface, config, metadata) = { - let tauri_config_guard = tauri_config.lock().unwrap(); - let tauri_config_ = tauri_config_guard.as_ref().unwrap(); + let interface = AppInterface::new(&tauri_config, dev_options.target.clone(), dirs.tauri)?; - let interface = AppInterface::new(tauri_config_, dev_options.target.clone())?; - - let app = get_app(MobileTarget::Android, tauri_config_, &interface); + let app = get_app(MobileTarget::Android, &tauri_config, &interface, dirs.tauri); let (config, metadata) = get_config( &app, - tauri_config_, + &tauri_config, dev_options.features.as_ref(), &Default::default(), ); (interface, config, metadata) }; - let tauri_path = tauri_dir(); - set_current_dir(tauri_path).context("failed to set current directory to Tauri directory")?; + set_current_dir(dirs.tauri).context("failed to set current directory to Tauri directory")?; ensure_init( &tauri_config, @@ -218,6 +216,7 @@ fn run_command(options: Options, noise_level: NoiseLevel) -> Result<()> { &config, &metadata, noise_level, + &dirs, ) } @@ -226,12 +225,13 @@ fn run_dev( mut interface: AppInterface, options: Options, mut dev_options: DevOptions, - tauri_config: ConfigHandle, + mut tauri_config: ConfigMetadata, device: Option, mut env: Env, config: &AndroidConfig, metadata: &AndroidMetadata, noise_level: NoiseLevel, + dirs: &Dirs, ) -> Result<()> { // when --host is provided or running on a physical device or resolving 0.0.0.0 we must use the network IP if options.host.0.is_some() @@ -239,25 +239,24 @@ fn run_dev( .as_ref() .map(|device| !device.serial_no().starts_with("emulator")) .unwrap_or(false) - || tauri_config - .lock() - .unwrap() - .as_ref() - .unwrap() - .build - .dev_url - .as_ref() - .is_some_and(|url| { - matches!( - url.host(), - Some(Host::Ipv4(i)) if i == Ipv4Addr::UNSPECIFIED - ) - }) + || tauri_config.build.dev_url.as_ref().is_some_and(|url| { + matches!( + url.host(), + Some(Host::Ipv4(i)) if i == Ipv4Addr::UNSPECIFIED + ) + }) { - use_network_address_for_dev_url(&tauri_config, &mut dev_options, options.force_ip_prompt)?; + use_network_address_for_dev_url( + &mut tauri_config, + &mut dev_options, + options.force_ip_prompt, + dirs.tauri, + )?; } - crate::dev::setup(&interface, &mut dev_options, tauri_config)?; + crate::dev::setup(&interface, &mut dev_options, &mut tauri_config, dirs)?; + + let tauri_config = Mutex::new(tauri_config); let interface_options = InterfaceOptions { debug: !dev_options.release_mode, @@ -266,12 +265,12 @@ fn run_dev( }; let app_settings = interface.app_settings(); - let out_dir = app_settings.out_dir(&interface_options)?; + let out_dir = app_settings.out_dir(&interface_options, dirs.tauri)?; let _lock = flock::open_rw(out_dir.join("lock").with_extension("android"), "Android")?; configure_cargo(&mut env, config)?; - generate_tauri_properties(config, tauri_config.lock().unwrap().as_ref().unwrap(), true)?; + generate_tauri_properties(config, &tauri_config.lock().unwrap(), true)?; let installed_targets = crate::interface::rust::installation::installed_targets().unwrap_or_default(); @@ -307,6 +306,7 @@ fn run_dev( let open = options.open; interface.mobile_dev( + &tauri_config, MobileOptions { debug: !options.release_mode, features: options.features, @@ -329,9 +329,9 @@ fn run_dev( }), }; - let _handle = write_options(tauri_config.lock().unwrap().as_ref().unwrap(), cli_options)?; + let _handle = write_options(&tauri_config.lock().unwrap(), cli_options)?; - inject_resources(config, tauri_config.lock().unwrap().as_ref().unwrap())?; + inject_resources(config, &tauri_config.lock().unwrap())?; if open { open_and_wait(config, &env) @@ -347,6 +347,7 @@ fn run_dev( open_and_wait(config, &env) } }, + dirs, ) } diff --git a/crates/tauri-cli/src/mobile/android/mod.rs b/crates/tauri-cli/src/mobile/android/mod.rs index 9a73f91e0..002ed73ac 100644 --- a/crates/tauri-cli/src/mobile/android/mod.rs +++ b/crates/tauri-cli/src/mobile/android/mod.rs @@ -104,18 +104,17 @@ enum Commands { } pub fn command(cli: Cli, verbosity: u8) -> Result<()> { + let dirs = crate::helpers::app_paths::resolve_dirs(); let noise_level = NoiseLevel::from_occurrences(verbosity as u64); match cli.command { - Commands::Init(options) => { - crate::helpers::app_paths::resolve(); - init_command( - MobileTarget::Android, - options.ci, - false, - options.skip_targets_install, - options.config, - )? - } + Commands::Init(options) => init_command( + MobileTarget::Android, + options.ci, + false, + options.skip_targets_install, + options.config, + &dirs, + )?, Commands::Dev(options) => dev::command(options, noise_level)?, Commands::Build(options) => build::command(options, noise_level).map(|_| ())?, Commands::Run(options) => run::command(options, noise_level)?, diff --git a/crates/tauri-cli/src/mobile/android/run.rs b/crates/tauri-cli/src/mobile/android/run.rs index 8bab82b84..986990ac3 100644 --- a/crates/tauri-cli/src/mobile/android/run.rs +++ b/crates/tauri-cli/src/mobile/android/run.rs @@ -9,6 +9,7 @@ use cargo_mobile2::{ }; use clap::{ArgAction, Parser}; use std::path::PathBuf; +use std::sync::Mutex; use super::{configure_cargo, device_prompt, env}; use crate::{ @@ -77,7 +78,18 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> { } }; - let mut built_application = super::build::command( + let dirs = crate::helpers::app_paths::resolve_dirs(); + let cfg = crate::helpers::config::get_config( + tauri_utils::platform::Target::Android, + &options + .config + .iter() + .map(|conf| &conf.0) + .collect::>(), + dirs.tauri, + )?; + let tauri_config = Mutex::new(cfg); + let mut built_application = super::build::run( super::build::Options { debug: !options.release, targets: device.as_ref().map(|d| { @@ -102,6 +114,8 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> { }), }, noise_level, + &dirs, + &tauri_config, )?; configure_cargo(&mut env, &built_application.config)?; @@ -139,11 +153,13 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> { runner()?; } else { built_application.interface.watch( + &tauri_config, WatcherOptions { config: options.config, additional_watch_folders: options.additional_watch_folders, }, runner, + &dirs, )?; } } diff --git a/crates/tauri-cli/src/mobile/init.rs b/crates/tauri-cli/src/mobile/init.rs index eef38d1e9..0a7324970 100644 --- a/crates/tauri-cli/src/mobile/init.rs +++ b/crates/tauri-cli/src/mobile/init.rs @@ -4,7 +4,8 @@ use super::{get_app, Target}; use crate::{ - helpers::{config::get as get_tauri_config, template::JsonMap}, + helpers::app_paths::Dirs, + helpers::{config::get_config as get_tauri_config, template::JsonMap}, interface::{AppInterface, Interface}, ConfigValue, Result, }; @@ -28,6 +29,7 @@ pub fn command( reinstall_deps: bool, skip_targets_install: bool, config: Vec, + dirs: &Dirs, ) -> Result<()> { let wrapper = TextWrapper::default(); @@ -38,6 +40,7 @@ pub fn command( reinstall_deps, skip_targets_install, config, + dirs, )?; Ok(()) } @@ -49,19 +52,19 @@ pub fn exec( #[allow(unused_variables)] reinstall_deps: bool, skip_targets_install: bool, config: Vec, + dirs: &Dirs, ) -> Result { let tauri_config = get_tauri_config( target.platform_target(), &config.iter().map(|conf| &conf.0).collect::>(), + dirs.tauri, )?; - let tauri_config_guard = tauri_config.lock().unwrap(); - let tauri_config_ = tauri_config_guard.as_ref().unwrap(); - let app = get_app( target, - tauri_config_, - &AppInterface::new(tauri_config_, None)?, + &tauri_config, + &AppInterface::new(&tauri_config, None, dirs.tauri)?, + dirs.tauri, ); let (handlebars, mut map) = handlebars(&app); @@ -135,7 +138,7 @@ pub fn exec( Target::Android => { let _env = super::android::env(non_interactive)?; let (config, metadata) = - super::android::get_config(&app, tauri_config_, &[], &Default::default()); + super::android::get_config(&app, &tauri_config, &[], &Default::default()); map.insert("android", &config); super::android::project::gen( &config, @@ -150,10 +153,10 @@ pub fn exec( // Generate Xcode project Target::Ios => { let (config, metadata) = - super::ios::get_config(&app, tauri_config_, &[], &Default::default())?; + super::ios::get_config(&app, &tauri_config, &[], &Default::default(), dirs.tauri)?; map.insert("apple", &config); super::ios::project::gen( - tauri_config_, + &tauri_config, &config, &metadata, (handlebars, map), diff --git a/crates/tauri-cli/src/mobile/ios/build.rs b/crates/tauri-cli/src/mobile/ios/build.rs index e8348726b..dba74df4e 100644 --- a/crates/tauri-cli/src/mobile/ios/build.rs +++ b/crates/tauri-cli/src/mobile/ios/build.rs @@ -11,8 +11,8 @@ use crate::{ build::Options as BuildOptions, error::{Context, ErrorExt}, helpers::{ - app_paths::tauri_dir, - config::{get as get_tauri_config, ConfigHandle}, + app_paths::Dirs, + config::{get_config as get_tauri_config, ConfigMetadata}, flock, plist::merge_plist, }, @@ -167,9 +167,7 @@ pub struct BuiltApplication { options_handle: OptionsHandle, } -pub fn command(options: Options, noise_level: NoiseLevel) -> Result { - crate::helpers::app_paths::resolve(); - +pub fn command(options: Options, noise_level: NoiseLevel, dirs: &Dirs) -> Result { let mut build_options: BuildOptions = options.clone().into(); build_options.target = Some( Target::all() @@ -189,26 +187,24 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result>(), + dirs.tauri, )?; let (interface, mut config) = { - let tauri_config_guard = tauri_config.lock().unwrap(); - let tauri_config_ = tauri_config_guard.as_ref().unwrap(); - - let interface = AppInterface::new(tauri_config_, build_options.target.clone())?; + let interface = AppInterface::new(&tauri_config, build_options.target.clone(), dirs.tauri)?; interface.build_options(&mut Vec::new(), &mut build_options.features, true); - let app = get_app(MobileTarget::Ios, tauri_config_, &interface); + let app = get_app(MobileTarget::Ios, &tauri_config, &interface, dirs.tauri); let (config, _metadata) = get_config( &app, - tauri_config_, + &tauri_config, &build_options.features, &Default::default(), + dirs.tauri, )?; (interface, config) }; - let tauri_path = tauri_dir(); - set_current_dir(tauri_path).context("failed to set current directory")?; + set_current_dir(dirs.tauri).context("failed to set current directory")?; ensure_init( &tauri_config, @@ -217,7 +213,7 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result Result Result Result { let profile = if options.debug { Profile::Debug @@ -367,20 +357,18 @@ fn run_build( Profile::Release }; - crate::build::setup( - interface, - &mut build_options, - tauri_config.lock().unwrap().as_ref().unwrap(), - true, - )?; + crate::build::setup(interface, &mut build_options, &tauri_config, true, dirs)?; let app_settings = interface.app_settings(); - let out_dir = app_settings.out_dir(&InterfaceOptions { - debug: build_options.debug, - target: build_options.target.clone(), - args: build_options.args.clone(), - ..Default::default() - })?; + let out_dir = app_settings.out_dir( + &InterfaceOptions { + debug: build_options.debug, + target: build_options.target.clone(), + args: build_options.args.clone(), + ..Default::default() + }, + dirs.tauri, + )?; let _lock = flock::open_rw(out_dir.join("lock").with_extension("ios"), "iOS")?; let cli_options = CliOptions { @@ -392,7 +380,7 @@ fn run_build( config: build_options.config.clone(), target_device: options.target_device.clone(), }; - let handle = write_options(tauri_config.lock().unwrap().as_ref().unwrap(), cli_options)?; + let handle = write_options(&tauri_config, cli_options)?; if options.open { return Ok(handle); diff --git a/crates/tauri-cli/src/mobile/ios/dev.rs b/crates/tauri-cli/src/mobile/ios/dev.rs index 2661581ef..6d9c8a697 100644 --- a/crates/tauri-cli/src/mobile/ios/dev.rs +++ b/crates/tauri-cli/src/mobile/ios/dev.rs @@ -10,8 +10,8 @@ use crate::{ dev::Options as DevOptions, error::{Context, ErrorExt}, helpers::{ - app_paths::tauri_dir, - config::{get as get_tauri_config, ConfigHandle}, + app_paths::Dirs, + config::{get_config as get_tauri_config, ConfigMetadata}, flock, plist::merge_plist, }, @@ -35,6 +35,7 @@ use cargo_mobile2::{ }; use url::Host; +use std::sync::Mutex; use std::{env::set_current_dir, net::Ipv4Addr, path::PathBuf}; const PHYSICAL_IPHONE_DEV_WARNING: &str = "To develop on physical phones you need the `--host` option (not required for Simulators). See the documentation for more information: https://v2.tauri.app/develop/#development-server"; @@ -138,16 +139,16 @@ impl From for DevOptions { } pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> { - crate::helpers::app_paths::resolve(); + let dirs = crate::helpers::app_paths::resolve_dirs(); - let result = run_command(options, noise_level); + let result = run_command(options, noise_level, dirs); if result.is_err() { crate::dev::kill_before_dev_process(); } result } -fn run_command(options: Options, noise_level: NoiseLevel) -> Result<()> { +fn run_command(options: Options, noise_level: NoiseLevel, dirs: Dirs) -> Result<()> { // setup env additions before calling env() if let Some(root_certificate_path) = &options.root_certificate_path { std::env::set_var( @@ -186,26 +187,24 @@ fn run_command(options: Options, noise_level: NoiseLevel) -> Result<()> { let tauri_config = get_tauri_config( tauri_utils::platform::Target::Ios, &options.config.iter().map(|c| &c.0).collect::>(), + dirs.tauri, )?; let (interface, config) = { - let tauri_config_guard = tauri_config.lock().unwrap(); - let tauri_config_ = tauri_config_guard.as_ref().unwrap(); + let interface = AppInterface::new(&tauri_config, Some(target_triple), dirs.tauri)?; - let interface = AppInterface::new(tauri_config_, Some(target_triple))?; - - let app = get_app(MobileTarget::Ios, tauri_config_, &interface); + let app = get_app(MobileTarget::Ios, &tauri_config, &interface, dirs.tauri); let (config, _metadata) = get_config( &app, - tauri_config_, + &tauri_config, &dev_options.features, &Default::default(), + dirs.tauri, )?; (interface, config) }; - let tauri_path = tauri_dir(); - set_current_dir(tauri_path).context("failed to set current directory to Tauri directory")?; + set_current_dir(dirs.tauri).context("failed to set current directory to Tauri directory")?; ensure_init( &tauri_config, @@ -214,28 +213,20 @@ fn run_command(options: Options, noise_level: NoiseLevel) -> Result<()> { MobileTarget::Ios, false, )?; - inject_resources(&config, tauri_config.lock().unwrap().as_ref().unwrap())?; + inject_resources(&config, &tauri_config)?; let info_plist_path = config .project_dir() .join(config.scheme()) .join("Info.plist"); let mut src_plists = vec![info_plist_path.clone().into()]; - if tauri_path.join("Info.plist").exists() { - src_plists.push(tauri_path.join("Info.plist").into()); + if dirs.tauri.join("Info.plist").exists() { + src_plists.push(dirs.tauri.join("Info.plist").into()); } - if tauri_path.join("Info.ios.plist").exists() { - src_plists.push(tauri_path.join("Info.ios.plist").into()); + if dirs.tauri.join("Info.ios.plist").exists() { + src_plists.push(dirs.tauri.join("Info.ios.plist").into()); } - if let Some(info_plist) = &tauri_config - .lock() - .unwrap() - .as_ref() - .unwrap() - .bundle - .ios - .info_plist - { + if let Some(info_plist) = &tauri_config.bundle.ios.info_plist { src_plists.push(info_plist.clone().into()); } let merged_info_plist = merge_plist(src_plists)?; @@ -274,6 +265,7 @@ fn run_command(options: Options, noise_level: NoiseLevel) -> Result<()> { env, &config, noise_level, + &dirs, ) } @@ -282,11 +274,12 @@ fn run_dev( mut interface: AppInterface, options: Options, mut dev_options: DevOptions, - tauri_config: ConfigHandle, + mut tauri_config: ConfigMetadata, device: Option, env: Env, config: &AppleConfig, noise_level: NoiseLevel, + dirs: &Dirs, ) -> Result<()> { // when --host is provided or running on a physical device or resolving 0.0.0.0 we must use the network IP if options.host.0.is_some() @@ -294,38 +287,41 @@ fn run_dev( .as_ref() .map(|device| !matches!(device.kind(), DeviceKind::Simulator)) .unwrap_or(false) - || tauri_config - .lock() - .unwrap() - .as_ref() - .unwrap() - .build - .dev_url - .as_ref() - .is_some_and(|url| { - matches!( + || tauri_config.build.dev_url.as_ref().is_some_and(|url| { + matches!( url.host(), Some(Host::Ipv4(i)) if i == Ipv4Addr::UNSPECIFIED - ) - }) + ) + }) { - use_network_address_for_dev_url(&tauri_config, &mut dev_options, options.force_ip_prompt)?; + use_network_address_for_dev_url( + &mut tauri_config, + &mut dev_options, + options.force_ip_prompt, + dirs.tauri, + )?; } - crate::dev::setup(&interface, &mut dev_options, tauri_config.clone())?; + crate::dev::setup(&interface, &mut dev_options, &mut tauri_config, &dirs)?; + + let tauri_config = Mutex::new(tauri_config); let app_settings = interface.app_settings(); - let out_dir = app_settings.out_dir(&InterfaceOptions { - debug: !dev_options.release_mode, - target: dev_options.target.clone(), - ..Default::default() - })?; + let out_dir = app_settings.out_dir( + &InterfaceOptions { + debug: !dev_options.release_mode, + target: dev_options.target.clone(), + ..Default::default() + }, + dirs.tauri, + )?; let _lock = flock::open_rw(out_dir.join("lock").with_extension("ios"), "iOS")?; let set_host = options.host.0.is_some(); let open = options.open; interface.mobile_dev( + &tauri_config, MobileOptions { debug: true, features: options.features, @@ -344,7 +340,7 @@ fn run_dev( config: dev_options.config.clone(), target_device: None, }; - let _handle = write_options(tauri_config.lock().unwrap().as_ref().unwrap(), cli_options)?; + let _handle = write_options(&tauri_config.lock().unwrap(), cli_options)?; let open_xcode = || { if !set_host { @@ -371,6 +367,7 @@ fn run_dev( open_xcode() } }, + &dirs, ) } diff --git a/crates/tauri-cli/src/mobile/ios/mod.rs b/crates/tauri-cli/src/mobile/ios/mod.rs index d589f76a6..0590e772a 100644 --- a/crates/tauri-cli/src/mobile/ios/mod.rs +++ b/crates/tauri-cli/src/mobile/ios/mod.rs @@ -30,8 +30,7 @@ use super::{ use crate::{ error::{Context, ErrorExt}, helpers::{ - app_paths::tauri_dir, - config::{BundleResources, Config as TauriConfig, ConfigHandle}, + config::{BundleResources, Config as TauriConfig, ConfigMetadata}, pbxproj, strip_semver_prerelease_tag, }, ConfigValue, Error, Result, @@ -103,19 +102,18 @@ enum Commands { pub fn command(cli: Cli, verbosity: u8) -> Result<()> { let noise_level = NoiseLevel::from_occurrences(verbosity as u64); + let dirs = crate::helpers::app_paths::resolve_dirs(); match cli.command { - Commands::Init(options) => { - crate::helpers::app_paths::resolve(); - init_command( - MobileTarget::Ios, - options.ci, - options.reinstall_deps, - options.skip_targets_install, - options.config, - )? - } + Commands::Init(options) => init_command( + MobileTarget::Ios, + options.ci, + options.reinstall_deps, + options.skip_targets_install, + options.config, + &dirs, + )?, Commands::Dev(options) => dev::command(options, noise_level)?, - Commands::Build(options) => build::command(options, noise_level).map(|_| ())?, + Commands::Build(options) => build::command(options, noise_level, &dirs).map(|_| ())?, Commands::Run(options) => run::command(options, noise_level)?, Commands::XcodeScript(options) => xcode_script::command(options)?, } @@ -128,6 +126,7 @@ pub fn get_config( tauri_config: &TauriConfig, features: &[String], cli_options: &CliOptions, + tauri_dir: &Path, ) -> Result<(AppleConfig, AppleMetadata)> { let mut ios_options = cli_options.clone(); ios_options.features.extend_from_slice(features); @@ -236,8 +235,6 @@ pub fn get_config( let config = AppleConfig::from_raw(app.clone(), Some(raw)) .context("failed to create Apple configuration")?; - let tauri_dir = tauri_dir(); - let mut vendor_frameworks = Vec::new(); let mut frameworks = Vec::new(); for framework in tauri_config @@ -272,11 +269,7 @@ pub fn get_config( supported: true, ios: ApplePlatform { cargo_args: Some(ios_options.args), - features: if ios_options.features.is_empty() { - None - } else { - Some(ios_options.features) - }, + features: Some(ios_options.features), frameworks: Some(frameworks), vendor_frameworks: Some(vendor_frameworks), ..Default::default() @@ -553,26 +546,14 @@ pub fn load_pbxproj(config: &AppleConfig) -> Result { pub fn synchronize_project_config( config: &AppleConfig, - tauri_config: &ConfigHandle, + tauri_config: &ConfigMetadata, pbxproj: &mut pbxproj::Pbxproj, export_options_plist: &mut plist::Dictionary, project_config: &ProjectConfig, debug: bool, ) -> Result<()> { - let identifier = tauri_config - .lock() - .unwrap() - .as_ref() - .unwrap() - .identifier - .clone(); - let product_name = tauri_config - .lock() - .unwrap() - .as_ref() - .unwrap() - .product_name - .clone(); + let identifier = tauri_config.identifier.clone(); + let product_name = tauri_config.product_name.clone(); let manual_signing = project_config.code_sign_identity.is_some() || project_config.provisioning_profile_uuid.is_some(); diff --git a/crates/tauri-cli/src/mobile/ios/run.rs b/crates/tauri-cli/src/mobile/ios/run.rs index 844e2f4c8..7d18cdb60 100644 --- a/crates/tauri-cli/src/mobile/ios/run.rs +++ b/crates/tauri-cli/src/mobile/ios/run.rs @@ -3,6 +3,7 @@ // SPDX-License-Identifier: MIT use std::path::PathBuf; +use std::sync::Mutex; use cargo_mobile2::opts::{NoiseLevel, Profile}; use clap::{ArgAction, Parser}; @@ -10,6 +11,7 @@ use clap::{ArgAction, Parser}; use super::{device_prompt, env}; use crate::{ error::Context, + helpers::config::get_config as get_tauri_config, interface::{DevProcess, Interface, WatcherOptions}, mobile::{DevChild, TargetDevice}, ConfigValue, Result, @@ -73,6 +75,8 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> { } }; + let dirs = crate::helpers::app_paths::resolve_dirs(); + let mut built_application = super::build::command( super::build::Options { debug: !options.release, @@ -91,8 +95,16 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> { }), }, noise_level, + &dirs, )?; + let cfg = get_tauri_config( + tauri_utils::platform::Target::Ios, + &options.config.iter().map(|c| &c.0).collect::>(), + dirs.tauri, + )?; + let tauri_config = Mutex::new(cfg); + // options.open is handled by the build command // so all we need to do here is run the app on the selected device if let Some(device) = device { @@ -117,11 +129,13 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> { runner()?; } else { built_application.interface.watch( + &tauri_config, WatcherOptions { config: options.config, additional_watch_folders: options.additional_watch_folders, }, runner, + &dirs, )?; } } diff --git a/crates/tauri-cli/src/mobile/ios/xcode_script.rs b/crates/tauri-cli/src/mobile/ios/xcode_script.rs index 25955c5ae..0b30ba2f4 100644 --- a/crates/tauri-cli/src/mobile/ios/xcode_script.rs +++ b/crates/tauri-cli/src/mobile/ios/xcode_script.rs @@ -5,7 +5,7 @@ use super::{ensure_init, env, get_app, get_config, read_options, MobileTarget}; use crate::{ error::{Context, ErrorExt}, - helpers::config::{get as get_tauri_config, reload as reload_tauri_config}, + helpers::config::{get_config as get_tauri_config, reload_config as reload_tauri_config}, interface::{AppInterface, Interface, Options as InterfaceOptions}, mobile::ios::LIB_OUTPUT_FILE_NAME, Error, Result, @@ -89,47 +89,43 @@ pub fn command(options: Options) -> Result<()> { .unwrap(); } - crate::helpers::app_paths::resolve(); + let dirs = crate::helpers::app_paths::resolve_dirs(); let profile = profile_from_configuration(&options.configuration); let macos = macos_from_platform(&options.platform); - let (tauri_config, cli_options) = { - let tauri_config = get_tauri_config(tauri_utils::platform::Target::Ios, &[])?; - let cli_options = { - let tauri_config_guard = tauri_config.lock().unwrap(); - let tauri_config_ = tauri_config_guard.as_ref().unwrap(); - read_options(tauri_config_) - }; - let tauri_config = if cli_options.config.is_empty() { - tauri_config - } else { + let mut tauri_config = get_tauri_config(tauri_utils::platform::Target::Ios, &[], dirs.tauri)?; + let cli_options = { + let cli_options = { read_options(&tauri_config) }; + if !cli_options.config.is_empty() { // reload config with merges from the ios dev|build script reload_tauri_config( + &mut tauri_config, &cli_options .config .iter() .map(|conf| &conf.0) .collect::>(), + dirs.tauri, )? }; - (tauri_config, cli_options) + cli_options }; let (config, metadata) = { - let tauri_config_guard = tauri_config.lock().unwrap(); - let tauri_config_ = tauri_config_guard.as_ref().unwrap(); - let cli_options = read_options(tauri_config_); + let cli_options = read_options(&tauri_config); let (config, metadata) = get_config( &get_app( MobileTarget::Ios, - tauri_config_, - &AppInterface::new(tauri_config_, None)?, + &tauri_config, + &AppInterface::new(&tauri_config, None, dirs.tauri)?, + dirs.tauri, ), - tauri_config_, + &tauri_config, &[], &cli_options, + dirs.tauri, )?; (config, metadata) }; @@ -142,7 +138,8 @@ pub fn command(options: Options) -> Result<()> { )?; if !cli_options.config.is_empty() { - crate::helpers::config::merge_with( + crate::helpers::config::merge_config_with( + &mut tauri_config, &cli_options .config .iter() @@ -236,10 +233,7 @@ pub fn command(options: Options) -> Result<()> { } }; - let interface = AppInterface::new( - tauri_config.lock().unwrap().as_ref().unwrap(), - Some(rust_triple.into()), - )?; + let interface = AppInterface::new(&tauri_config, Some(rust_triple.into()), dirs.tauri)?; let cflags = format!("CFLAGS_{env_triple}"); let cxxflags = format!("CFLAGS_{env_triple}"); @@ -280,11 +274,14 @@ pub fn command(options: Options) -> Result<()> { ) .context("failed to compile iOS app")?; - let out_dir = interface.app_settings().out_dir(&InterfaceOptions { - debug: matches!(profile, Profile::Debug), - target: Some(rust_triple.into()), - ..Default::default() - })?; + let out_dir = interface.app_settings().out_dir( + &InterfaceOptions { + debug: matches!(profile, Profile::Debug), + target: Some(rust_triple.into()), + ..Default::default() + }, + dirs.tauri, + )?; let lib_path = out_dir.join(format!("lib{}.a", config.app().lib_name())); if !lib_path.exists() { diff --git a/crates/tauri-cli/src/mobile/mod.rs b/crates/tauri-cli/src/mobile/mod.rs index b94543d65..6b06e0cac 100644 --- a/crates/tauri-cli/src/mobile/mod.rs +++ b/crates/tauri-cli/src/mobile/mod.rs @@ -4,10 +4,7 @@ use crate::{ error::{Context, ErrorExt}, - helpers::{ - app_paths::tauri_dir, - config::{reload as reload_config, Config as TauriConfig, ConfigHandle, ConfigMetadata}, - }, + helpers::config::{reload_config, Config as TauriConfig, ConfigMetadata}, interface::{AppInterface, AppSettings, DevProcess, Interface, Options as InterfaceOptions}, ConfigValue, Error, Result, }; @@ -31,7 +28,7 @@ use std::{ fmt::{Display, Write}, fs::{read_to_string, write}, net::{AddrParseError, IpAddr, Ipv4Addr, SocketAddr}, - path::PathBuf, + path::{Path, PathBuf}, process::{exit, ExitStatus}, str::FromStr, sync::{ @@ -217,12 +214,9 @@ fn local_ip_address(force: bool) -> &'static IpAddr { }) .collect(); - match addresses.len() { - 0 => panic!("No external IP detected."), - 1 => { - let ipaddr = addresses.first().unwrap(); - *ipaddr - } + match addresses.as_slice() { + [] => panic!("No external IP detected."), + [ipaddr] => *ipaddr, _ => { let selected = dialoguer::Select::with_theme(&dialoguer::theme::ColorfulTheme::default()) .with_prompt( @@ -252,18 +246,12 @@ struct DevUrlConfig { } fn use_network_address_for_dev_url( - config: &ConfigHandle, + config: &mut ConfigMetadata, dev_options: &mut crate::dev::Options, force_ip_prompt: bool, + tauri_dir: &Path, ) -> crate::Result { - let mut dev_url = config - .lock() - .unwrap() - .as_ref() - .unwrap() - .build - .dev_url - .clone(); + let mut dev_url = config.build.dev_url.clone(); let ip = if let Some(url) = &mut dev_url { let localhost = match url.host() { @@ -299,11 +287,13 @@ fn use_network_address_for_dev_url( }))); reload_config( + config, &dev_options .config .iter() .map(|conf| &conf.0) .collect::>(), + tauri_dir, )?; Some(ip) @@ -441,7 +431,12 @@ fn read_options(config: &ConfigMetadata) -> CliOptions { options } -pub fn get_app(target: Target, config: &TauriConfig, interface: &AppInterface) -> App { +pub fn get_app( + target: Target, + config: &TauriConfig, + interface: &AppInterface, + tauri_dir: &Path, +) -> App { let identifier = match target { Target::Android => config.identifier.replace('-', "_"), #[cfg(target_os = "macos")] @@ -478,22 +473,26 @@ pub fn get_app(target: Target, config: &TauriConfig, interface: &AppInterface) - }; let app_settings = interface.app_settings(); - App::from_raw(tauri_dir().to_path_buf(), raw) + let tauri_dir = tauri_dir.to_path_buf(); + App::from_raw(tauri_dir.to_path_buf(), raw) .unwrap() .with_target_dir_resolver(move |target, profile| { app_settings - .out_dir(&InterfaceOptions { - debug: matches!(profile, Profile::Debug), - target: Some(target.into()), - ..Default::default() - }) + .out_dir( + &InterfaceOptions { + debug: matches!(profile, Profile::Debug), + target: Some(target.into()), + ..Default::default() + }, + &tauri_dir, + ) .expect("failed to resolve target directory") }) } #[allow(unused_variables)] fn ensure_init( - tauri_config: &ConfigHandle, + tauri_config: &ConfigMetadata, app: &App, project_dir: PathBuf, target: Target, @@ -508,16 +507,13 @@ fn ensure_init( ) } - let tauri_config_guard = tauri_config.lock().unwrap(); - let tauri_config_ = tauri_config_guard.as_ref().unwrap(); - let mut project_outdated_reasons = Vec::new(); match target { Target::Android => { let java_folder = project_dir .join("app/src/main/java") - .join(tauri_config_.identifier.replace('.', "/").replace('-', "_")); + .join(tauri_config.identifier.replace('.', "/").replace('-', "_")); if java_folder.exists() { #[cfg(unix)] ensure_gradlew(&project_dir)?; diff --git a/crates/tauri-cli/src/remove.rs b/crates/tauri-cli/src/remove.rs index 319f60e82..ba20ae778 100644 --- a/crates/tauri-cli/src/remove.rs +++ b/crates/tauri-cli/src/remove.rs @@ -6,11 +6,7 @@ use clap::Parser; use crate::{ acl, - helpers::{ - app_paths::{resolve_frontend_dir, tauri_dir}, - cargo, - npm::PackageManager, - }, + helpers::{app_paths::resolve_frontend_dir, cargo, npm::PackageManager}, Result, }; @@ -22,11 +18,7 @@ pub struct Options { } pub fn command(options: Options) -> Result<()> { - crate::helpers::app_paths::resolve(); - run(options) -} - -pub fn run(options: Options) -> Result<()> { + let dirs = crate::helpers::app_paths::resolve_dirs(); let plugin = options.plugin; let crate_name = format!("tauri-plugin-{plugin}"); @@ -35,7 +27,6 @@ pub fn run(options: Options) -> Result<()> { let metadata = plugins.remove(plugin.as_str()).unwrap_or_default(); let frontend_dir = resolve_frontend_dir(); - let tauri_dir = tauri_dir(); let target_str = metadata .desktop_only @@ -48,14 +39,14 @@ pub fn run(options: Options) -> Result<()> { cargo::uninstall_one(cargo::CargoUninstallOptions { name: &crate_name, - cwd: Some(tauri_dir), + cwd: Some(dirs.tauri), target: target_str, })?; if !metadata.rust_only { if let Some(manager) = frontend_dir.map(PackageManager::from_project) { let npm_name = format!("@tauri-apps/plugin-{plugin}"); - manager.remove(&[npm_name], tauri_dir)?; + manager.remove(&[npm_name], dirs.tauri)?; } acl::permission::rm::command(acl::permission::rm::Options { From ea31b07f19e0aa467ed0f921f60575cfe09809c8 Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Sun, 18 Jan 2026 01:23:12 +0800 Subject: [PATCH 47/57] fix(cli): `inspect`'s description (#14789) --- .changes/fix-inspect-description.md | 6 ++++++ crates/tauri-cli/src/inspect.rs | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changes/fix-inspect-description.md diff --git a/.changes/fix-inspect-description.md b/.changes/fix-inspect-description.md new file mode 100644 index 000000000..df1c87db9 --- /dev/null +++ b/.changes/fix-inspect-description.md @@ -0,0 +1,6 @@ +--- +"@tauri-apps/cli": patch:bug +"tauri-cli": patch:bug +--- + +Fixed the command description for `tauri inspect` diff --git a/crates/tauri-cli/src/inspect.rs b/crates/tauri-cli/src/inspect.rs index a2bb3bfa1..de26dd984 100644 --- a/crates/tauri-cli/src/inspect.rs +++ b/crates/tauri-cli/src/inspect.rs @@ -9,7 +9,7 @@ use clap::{Parser, Subcommand}; use crate::interface::{AppInterface, AppSettings, Interface}; #[derive(Debug, Parser)] -#[clap(about = "Manage or create permissions for your app or plugin")] +#[clap(about = "Inspect values used by Tauri")] pub struct Cli { #[clap(subcommand)] command: Commands, @@ -40,8 +40,7 @@ fn wix_upgrade_code(tauri_dir: &Path) -> Result<()> { let upgrade_code = uuid::Uuid::new_v5( &uuid::Uuid::NAMESPACE_DNS, format!("{product_name}.exe.app.x64").as_bytes(), - ) - .to_string(); + ); log::info!("Default WiX Upgrade Code, derived from {product_name}: {upgrade_code}"); if let Some(code) = config From 10a8066db309a2793a7a5ef95179a5cb77339f4b Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Sun, 18 Jan 2026 20:57:36 +0800 Subject: [PATCH 48/57] refactor(cli): reorder a few parameters (#14792) --- crates/tauri-cli/src/build.rs | 6 +++--- crates/tauri-cli/src/bundle.rs | 4 ++-- crates/tauri-cli/src/helpers/config.rs | 6 ++---- crates/tauri-cli/src/interface/rust/manifest.rs | 5 +---- crates/tauri-cli/src/mobile/android/build.rs | 2 +- crates/tauri-cli/src/mobile/ios/build.rs | 2 +- 6 files changed, 10 insertions(+), 15 deletions(-) diff --git a/crates/tauri-cli/src/build.rs b/crates/tauri-cli/src/build.rs index 754b1793e..b43b3c9ae 100644 --- a/crates/tauri-cli/src/build.rs +++ b/crates/tauri-cli/src/build.rs @@ -104,7 +104,7 @@ pub fn command(mut options: Options, verbosity: u8) -> Result<()> { let mut interface = AppInterface::new(&config, options.target.clone(), dirs.tauri)?; - setup(&interface, &mut options, &config, false, &dirs)?; + setup(&interface, &mut options, &config, &dirs, false)?; if let Some(minimum_system_version) = &config.bundle.macos.minimum_system_version { std::env::set_var("MACOSX_DEPLOYMENT_TARGET", minimum_system_version); @@ -129,8 +129,8 @@ pub fn command(mut options: Options, verbosity: u8) -> Result<()> { &interface, &*app_settings, &config, - &out_dir, &dirs, + &out_dir, )?; } @@ -141,8 +141,8 @@ pub fn setup( interface: &AppInterface, options: &mut Options, config: &ConfigMetadata, - mobile: bool, dirs: &Dirs, + mobile: bool, ) -> Result<()> { // TODO: Maybe optimize this to run in parallel in the future // see https://github.com/tauri-apps/tauri/pull/13993#discussion_r2280697117 diff --git a/crates/tauri-cli/src/bundle.rs b/crates/tauri-cli/src/bundle.rs index 57e4a6f38..638c215e9 100644 --- a/crates/tauri-cli/src/bundle.rs +++ b/crates/tauri-cli/src/bundle.rs @@ -154,8 +154,8 @@ pub fn command(options: Options, verbosity: u8) -> crate::Result<()> { &interface, &*app_settings, &config, - &out_dir, &dirs, + &out_dir, ) } @@ -167,8 +167,8 @@ pub fn bundle( interface: &AppInterface, app_settings: &A, config: &ConfigMetadata, - out_dir: &Path, dirs: &Dirs, + out_dir: &Path, ) -> crate::Result<()> { let package_types: Vec = if let Some(bundles) = &options.bundles { bundles.iter().map(|bundle| bundle.0).collect::>() diff --git a/crates/tauri-cli/src/helpers/config.rs b/crates/tauri-cli/src/helpers/config.rs index d819867bd..ce1f11c5b 100644 --- a/crates/tauri-cli/src/helpers/config.rs +++ b/crates/tauri-cli/src/helpers/config.rs @@ -55,8 +55,7 @@ impl ConfigMetadata { for (ext, config) in &self.extensions { if let Some(identifier) = config .as_object() - .and_then(|bundle_config| bundle_config.get("identifier")) - .and_then(|id| id.as_str()) + .and_then(|bundle_config| bundle_config.get("identifier")?.as_str()) { if identifier == self.inner.identifier { return Some(ext.clone()); @@ -163,8 +162,7 @@ fn load_config( let original_identifier = config .as_object() - .and_then(|config| config.get("identifier")) - .and_then(|id| id.as_str()) + .and_then(|config| config.get("identifier")?.as_str()) .map(ToString::to_string); if let Some((platform_config, config_path)) = diff --git a/crates/tauri-cli/src/interface/rust/manifest.rs b/crates/tauri-cli/src/interface/rust/manifest.rs index 58a5dd6c1..40d307c2b 100644 --- a/crates/tauri-cli/src/interface/rust/manifest.rs +++ b/crates/tauri-cli/src/interface/rust/manifest.rs @@ -351,10 +351,7 @@ mod tests { } else { None }; - if let Some(f) = item_table - .and_then(|t| t.get("features").cloned()) - .and_then(|f| f.as_array().cloned()) - { + if let Some(f) = item_table.and_then(|t| t.get("features")?.as_array().cloned()) { for feature in f.iter() { let feature = feature.as_str().expect("feature is not a string"); if !dep.all_cli_managed_features.contains(&feature) { diff --git a/crates/tauri-cli/src/mobile/android/build.rs b/crates/tauri-cli/src/mobile/android/build.rs index dee966a1f..8e672959c 100644 --- a/crates/tauri-cli/src/mobile/android/build.rs +++ b/crates/tauri-cli/src/mobile/android/build.rs @@ -188,7 +188,7 @@ pub fn run( generate_tauri_properties(&config, tauri_config, false)?; - crate::build::setup(&interface, &mut build_options, tauri_config, true, dirs)?; + crate::build::setup(&interface, &mut build_options, tauri_config, dirs, true)?; let installed_targets = crate::interface::rust::installation::installed_targets().unwrap_or_default(); diff --git a/crates/tauri-cli/src/mobile/ios/build.rs b/crates/tauri-cli/src/mobile/ios/build.rs index dba74df4e..160e0995e 100644 --- a/crates/tauri-cli/src/mobile/ios/build.rs +++ b/crates/tauri-cli/src/mobile/ios/build.rs @@ -357,7 +357,7 @@ fn run_build( Profile::Release }; - crate::build::setup(interface, &mut build_options, &tauri_config, true, dirs)?; + crate::build::setup(interface, &mut build_options, &tauri_config, dirs, true)?; let app_settings = interface.app_settings(); let out_dir = app_settings.out_dir( From 08e35fcda00050237377509742c9daebf1a10561 Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Sun, 18 Jan 2026 21:09:36 +0800 Subject: [PATCH 49/57] refactor(cli): remove mutex on config (#14791) * refactor(cli): remove mutex on config * Fix ios * Clippy * Fix ios * Unused import * Fix ios closure and clippy * Import `ConfigMetadata` * Remove life time tags --- crates/tauri-cli/src/dev.rs | 10 ++-- crates/tauri-cli/src/interface/mod.rs | 13 +++--- crates/tauri-cli/src/interface/rust.rs | 48 ++++++++++---------- crates/tauri-cli/src/mobile/android/build.rs | 8 ++-- crates/tauri-cli/src/mobile/android/dev.rs | 13 ++---- crates/tauri-cli/src/mobile/android/run.rs | 11 ++--- crates/tauri-cli/src/mobile/ios/dev.rs | 9 ++-- crates/tauri-cli/src/mobile/ios/run.rs | 12 ++--- 8 files changed, 57 insertions(+), 67 deletions(-) diff --git a/crates/tauri-cli/src/dev.rs b/crates/tauri-cli/src/dev.rs index 5bf62ef10..a66186919 100644 --- a/crates/tauri-cli/src/dev.rs +++ b/crates/tauri-cli/src/dev.rs @@ -113,22 +113,20 @@ fn command_internal(mut options: Options, dirs: Dirs) -> Result<()> { .map(Target::from_triple) .unwrap_or_else(Target::current); - let mut cfg = get_config( + let mut config = get_config( target, &options.config.iter().map(|c| &c.0).collect::>(), dirs.tauri, )?; - let mut interface = AppInterface::new(&cfg, options.target.clone(), dirs.tauri)?; + let mut interface = AppInterface::new(&config, options.target.clone(), dirs.tauri)?; - setup(&interface, &mut options, &mut cfg, &dirs)?; - - let config = Mutex::new(cfg); + setup(&interface, &mut options, &mut config, &dirs)?; let exit_on_panic = options.exit_on_panic; let no_watch = options.no_watch; interface.dev( - &config, + &mut config, options.into(), move |status, reason| on_app_exit(status, reason, exit_on_panic, no_watch), &dirs, diff --git a/crates/tauri-cli/src/interface/mod.rs b/crates/tauri-cli/src/interface/mod.rs index 8b797091d..dc15e7ecb 100644 --- a/crates/tauri-cli/src/interface/mod.rs +++ b/crates/tauri-cli/src/interface/mod.rs @@ -9,7 +9,6 @@ use std::{ path::{Path, PathBuf}, process::ExitStatus, sync::Arc, - sync::Mutex, }; use crate::{ @@ -115,21 +114,23 @@ pub trait Interface: Sized { fn build(&mut self, options: Options, dirs: &Dirs) -> crate::Result; fn dev, ExitReason) + Send + Sync + 'static>( &mut self, - config: &Mutex, + config: &mut ConfigMetadata, options: Options, on_exit: F, dirs: &Dirs, ) -> crate::Result<()>; - fn mobile_dev crate::Result>>( + fn mobile_dev< + R: Fn(MobileOptions, &ConfigMetadata) -> crate::Result>, + >( &mut self, - config: &Mutex, + config: &mut ConfigMetadata, options: MobileOptions, runner: R, dirs: &Dirs, ) -> crate::Result<()>; - fn watch crate::Result>>( + fn watch crate::Result>>( &mut self, - config: &Mutex, + config: &mut ConfigMetadata, options: WatcherOptions, runner: R, dirs: &Dirs, diff --git a/crates/tauri-cli/src/interface/rust.rs b/crates/tauri-cli/src/interface/rust.rs index a9a42363a..063d6a175 100644 --- a/crates/tauri-cli/src/interface/rust.rs +++ b/crates/tauri-cli/src/interface/rust.rs @@ -194,7 +194,7 @@ impl Interface for Rust { fn dev, ExitReason) + Send + Sync + 'static>( &mut self, - config: &Mutex, + config: &mut ConfigMetadata, mut options: Options, on_exit: F, dirs: &Dirs, @@ -221,25 +221,26 @@ impl Interface for Rust { Ok(()) } else { let merge_configs = options.config.iter().map(|c| &c.0).collect::>(); - let run = Arc::new(|rust: &mut Rust| { - let on_exit = on_exit.clone(); - rust.run_dev(options.clone(), run_args.clone(), move |status, reason| { - on_exit(status, reason) - }) - }); self.run_dev_watcher( config, &options.additional_watch_folders, &merge_configs, - run, + |rust: &mut Rust, _config| { + let on_exit = on_exit.clone(); + rust.run_dev(options.clone(), run_args.clone(), move |status, reason| { + on_exit(status, reason) + }) + }, dirs, ) } } - fn mobile_dev crate::Result>>( + fn mobile_dev< + R: Fn(MobileOptions, &ConfigMetadata) -> crate::Result>, + >( &mut self, - config: &Mutex, + config: &mut ConfigMetadata, mut options: MobileOptions, runner: R, dirs: &Dirs, @@ -254,7 +255,7 @@ impl Interface for Rust { ); if options.no_watch { - runner(options)?; + runner(options, config)?; Ok(()) } else { self.watch( @@ -263,26 +264,25 @@ impl Interface for Rust { config: options.config.clone(), additional_watch_folders: options.additional_watch_folders.clone(), }, - move || runner(options.clone()), + move |config| runner(options.clone(), config), dirs, ) } } - fn watch crate::Result>>( + fn watch crate::Result>>( &mut self, - config: &Mutex, + config: &mut ConfigMetadata, options: WatcherOptions, runner: R, dirs: &Dirs, ) -> crate::Result<()> { let merge_configs = options.config.iter().map(|c| &c.0).collect::>(); - let run = Arc::new(|_rust: &mut Rust| runner()); self.run_dev_watcher( config, &options.additional_watch_folders, &merge_configs, - run, + |_rust: &mut Rust, config| runner(config), dirs, ) } @@ -539,15 +539,17 @@ impl Rust { .map(|c| Box::new(c) as Box) } - fn run_dev_watcher crate::Result>>( + fn run_dev_watcher< + F: Fn(&mut Rust, &ConfigMetadata) -> crate::Result>, + >( &mut self, - config: &Mutex, + config: &mut ConfigMetadata, additional_watch_folders: &[PathBuf], merge_configs: &[&serde_json::Value], - run: Arc, + run: F, dirs: &Dirs, ) -> crate::Result<()> { - let child = run(self)?; + let child = run(self, config)?; let process = Arc::new(Mutex::new(child)); let (tx, rx) = sync_channel(1); @@ -593,9 +595,9 @@ impl Rust { if let Some(event_path) = event.paths.first() { if !ignore_matcher.is_ignore(event_path, event_path.is_dir()) { if is_configuration_file(self.app_settings.target_platform, event_path) - && reload_config(&mut config.lock().unwrap(), merge_configs, dirs.tauri).is_ok() + && reload_config(config, merge_configs, dirs.tauri).is_ok() { - let (manifest, modified) = rewrite_manifest(&config.lock().unwrap(), dirs.tauri)?; + let (manifest, modified) = rewrite_manifest(config, dirs.tauri)?; if modified { *self.app_settings.manifest.lock().unwrap() = manifest; // no need to run the watcher logic, the manifest was modified @@ -619,7 +621,7 @@ impl Rust { break; } } - *p = run(self)?; + *p = run(self, config)?; } } } diff --git a/crates/tauri-cli/src/mobile/android/build.rs b/crates/tauri-cli/src/mobile/android/build.rs index 8e672959c..5e5e7cd62 100644 --- a/crates/tauri-cli/src/mobile/android/build.rs +++ b/crates/tauri-cli/src/mobile/android/build.rs @@ -28,7 +28,6 @@ use cargo_mobile2::{ use std::env::set_current_dir; use std::path::Path; -use std::sync::Mutex; #[derive(Debug, Clone, Parser)] #[clap( @@ -119,7 +118,7 @@ pub struct BuiltApplication { pub fn command(options: Options, noise_level: NoiseLevel) -> Result { let dirs = crate::helpers::app_paths::resolve_dirs(); - let tauri_config = Mutex::new(get_tauri_config( + let tauri_config = get_tauri_config( tauri_utils::platform::Target::Android, &options .config @@ -127,7 +126,7 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result>(), dirs.tauri, - )?); + )?; run(options, noise_level, &dirs, &tauri_config) } @@ -135,7 +134,7 @@ pub fn run( options: Options, noise_level: NoiseLevel, dirs: &Dirs, - tauri_config: &Mutex, + tauri_config: &ConfigMetadata, ) -> Result { delete_codegen_vars(); @@ -151,7 +150,6 @@ pub fn run( ) .unwrap(); build_options.target = Some(first_target.triple.into()); - let tauri_config = &tauri_config.lock().unwrap(); let (interface, config, metadata) = { let interface = AppInterface::new(tauri_config, build_options.target.clone(), dirs.tauri)?; diff --git a/crates/tauri-cli/src/mobile/android/dev.rs b/crates/tauri-cli/src/mobile/android/dev.rs index bb4624980..a4cfaacd4 100644 --- a/crates/tauri-cli/src/mobile/android/dev.rs +++ b/crates/tauri-cli/src/mobile/android/dev.rs @@ -35,7 +35,6 @@ use cargo_mobile2::{ }; use url::Host; -use std::sync::Mutex; use std::{env::set_current_dir, net::Ipv4Addr, path::PathBuf}; #[derive(Debug, Clone, Parser)] @@ -256,8 +255,6 @@ fn run_dev( crate::dev::setup(&interface, &mut dev_options, &mut tauri_config, dirs)?; - let tauri_config = Mutex::new(tauri_config); - let interface_options = InterfaceOptions { debug: !dev_options.release_mode, target: dev_options.target.clone(), @@ -270,7 +267,7 @@ fn run_dev( configure_cargo(&mut env, config)?; - generate_tauri_properties(config, &tauri_config.lock().unwrap(), true)?; + generate_tauri_properties(config, &tauri_config, true)?; let installed_targets = crate::interface::rust::installation::installed_targets().unwrap_or_default(); @@ -306,7 +303,7 @@ fn run_dev( let open = options.open; interface.mobile_dev( - &tauri_config, + &mut tauri_config, MobileOptions { debug: !options.release_mode, features: options.features, @@ -315,7 +312,7 @@ fn run_dev( no_watch: options.no_watch, additional_watch_folders: options.additional_watch_folders, }, - |options| { + |options, tauri_config| { let cli_options = CliOptions { dev: true, features: options.features.clone(), @@ -329,9 +326,9 @@ fn run_dev( }), }; - let _handle = write_options(&tauri_config.lock().unwrap(), cli_options)?; + let _handle = write_options(tauri_config, cli_options)?; - inject_resources(config, &tauri_config.lock().unwrap())?; + inject_resources(config, tauri_config)?; if open { open_and_wait(config, &env) diff --git a/crates/tauri-cli/src/mobile/android/run.rs b/crates/tauri-cli/src/mobile/android/run.rs index 986990ac3..736ca84d6 100644 --- a/crates/tauri-cli/src/mobile/android/run.rs +++ b/crates/tauri-cli/src/mobile/android/run.rs @@ -9,11 +9,11 @@ use cargo_mobile2::{ }; use clap::{ArgAction, Parser}; use std::path::PathBuf; -use std::sync::Mutex; use super::{configure_cargo, device_prompt, env}; use crate::{ error::Context, + helpers::config::ConfigMetadata, interface::{DevProcess, Interface, WatcherOptions}, mobile::{DevChild, TargetDevice}, ConfigValue, Result, @@ -79,7 +79,7 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> { }; let dirs = crate::helpers::app_paths::resolve_dirs(); - let cfg = crate::helpers::config::get_config( + let mut tauri_config = crate::helpers::config::get_config( tauri_utils::platform::Target::Android, &options .config @@ -88,7 +88,6 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> { .collect::>(), dirs.tauri, )?; - let tauri_config = Mutex::new(cfg); let mut built_application = super::build::run( super::build::Options { debug: !options.release, @@ -125,7 +124,7 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> { if let Some(device) = device { let config = built_application.config.clone(); let release = options.release; - let runner = move || { + let runner = move |_tauri_config: &ConfigMetadata| { device .run( &config, @@ -150,10 +149,10 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> { }; if options.no_watch { - runner()?; + runner(&tauri_config)?; } else { built_application.interface.watch( - &tauri_config, + &mut tauri_config, WatcherOptions { config: options.config, additional_watch_folders: options.additional_watch_folders, diff --git a/crates/tauri-cli/src/mobile/ios/dev.rs b/crates/tauri-cli/src/mobile/ios/dev.rs index 6d9c8a697..397875ac2 100644 --- a/crates/tauri-cli/src/mobile/ios/dev.rs +++ b/crates/tauri-cli/src/mobile/ios/dev.rs @@ -35,7 +35,6 @@ use cargo_mobile2::{ }; use url::Host; -use std::sync::Mutex; use std::{env::set_current_dir, net::Ipv4Addr, path::PathBuf}; const PHYSICAL_IPHONE_DEV_WARNING: &str = "To develop on physical phones you need the `--host` option (not required for Simulators). See the documentation for more information: https://v2.tauri.app/develop/#development-server"; @@ -304,8 +303,6 @@ fn run_dev( crate::dev::setup(&interface, &mut dev_options, &mut tauri_config, &dirs)?; - let tauri_config = Mutex::new(tauri_config); - let app_settings = interface.app_settings(); let out_dir = app_settings.out_dir( &InterfaceOptions { @@ -321,7 +318,7 @@ fn run_dev( let open = options.open; interface.mobile_dev( - &tauri_config, + &mut tauri_config, MobileOptions { debug: true, features: options.features, @@ -330,7 +327,7 @@ fn run_dev( no_watch: options.no_watch, additional_watch_folders: options.additional_watch_folders, }, - |options| { + |options, tauri_config| { let cli_options = CliOptions { dev: true, features: options.features.clone(), @@ -340,7 +337,7 @@ fn run_dev( config: dev_options.config.clone(), target_device: None, }; - let _handle = write_options(&tauri_config.lock().unwrap(), cli_options)?; + let _handle = write_options(tauri_config, cli_options)?; let open_xcode = || { if !set_host { diff --git a/crates/tauri-cli/src/mobile/ios/run.rs b/crates/tauri-cli/src/mobile/ios/run.rs index 7d18cdb60..6c75c5acc 100644 --- a/crates/tauri-cli/src/mobile/ios/run.rs +++ b/crates/tauri-cli/src/mobile/ios/run.rs @@ -3,7 +3,6 @@ // SPDX-License-Identifier: MIT use std::path::PathBuf; -use std::sync::Mutex; use cargo_mobile2::opts::{NoiseLevel, Profile}; use clap::{ArgAction, Parser}; @@ -11,7 +10,7 @@ use clap::{ArgAction, Parser}; use super::{device_prompt, env}; use crate::{ error::Context, - helpers::config::get_config as get_tauri_config, + helpers::config::{get_config as get_tauri_config, ConfigMetadata}, interface::{DevProcess, Interface, WatcherOptions}, mobile::{DevChild, TargetDevice}, ConfigValue, Result, @@ -98,17 +97,16 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> { &dirs, )?; - let cfg = get_tauri_config( + let mut tauri_config = get_tauri_config( tauri_utils::platform::Target::Ios, &options.config.iter().map(|c| &c.0).collect::>(), dirs.tauri, )?; - let tauri_config = Mutex::new(cfg); // options.open is handled by the build command // so all we need to do here is run the app on the selected device if let Some(device) = device { - let runner = move || { + let runner = move |_tauri_config: &ConfigMetadata| { device .run( &built_application.config, @@ -126,10 +124,10 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> { }; if options.no_watch { - runner()?; + runner(&tauri_config)?; } else { built_application.interface.watch( - &tauri_config, + &mut tauri_config, WatcherOptions { config: options.config, additional_watch_folders: options.additional_watch_folders, From eccff97588232055bd0cafd83e6ee03d11a501fb Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Sun, 18 Jan 2026 15:01:36 -0300 Subject: [PATCH 50/57] fix(cli): possibly empty associated-domains entitlement (#14779) --- .changes/fix-empty-entitlements.md | 6 ++++++ crates/tauri-cli/src/interface/rust.rs | 18 ++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 .changes/fix-empty-entitlements.md diff --git a/.changes/fix-empty-entitlements.md b/.changes/fix-empty-entitlements.md new file mode 100644 index 000000000..0bc9eea40 --- /dev/null +++ b/.changes/fix-empty-entitlements.md @@ -0,0 +1,6 @@ +--- +"tauri-cli": patch:bug +"@tauri-apps/cli": patch:bug +--- + +Fix empty associated-domains entitlements when domains are not configured for deep links. diff --git a/crates/tauri-cli/src/interface/rust.rs b/crates/tauri-cli/src/interface/rust.rs index 063d6a175..a960ecc9a 100644 --- a/crates/tauri-cli/src/interface/rust.rs +++ b/crates/tauri-cli/src/interface/rust.rs @@ -1454,14 +1454,16 @@ fn tauri_config_to_bundle_settings( .map(tauri_bundler::bundle::Entitlements::Path) } else { let mut app_links_entitlements = plist::Dictionary::new(); - app_links_entitlements.insert( - "com.apple.developer.associated-domains".to_string(), - domains - .into_iter() - .map(|domain| format!("applinks:{domain}").into()) - .collect::>() - .into(), - ); + if !domains.is_empty() { + app_links_entitlements.insert( + "com.apple.developer.associated-domains".to_string(), + domains + .into_iter() + .map(|domain| format!("applinks:{domain}").into()) + .collect::>() + .into(), + ); + } let entitlements = if let Some(user_provided_entitlements) = config.macos.entitlements { crate::helpers::plist::merge_plist(vec![ PathBuf::from(user_provided_entitlements).into(), From 0575dd287e021b61d2aedf64d62ae84a2c925fb4 Mon Sep 17 00:00:00 2001 From: kandrelczyk Date: Sun, 18 Jan 2026 23:51:02 +0100 Subject: [PATCH 51/57] fix(bundler): patch bundle type via string replacement (#14521) Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com> Co-authored-by: FabianLars --- .changes/fix-binary-patching.md | 8 ++ crates/tauri-bundler/src/bundle.rs | 94 +++++++++++-------- crates/tauri-bundler/src/bundle/kmp/mod.rs | 61 ++++++++++++ crates/tauri-bundler/src/bundle/linux/mod.rs | 5 - crates/tauri-bundler/src/bundle/linux/util.rs | 59 ------------ .../tauri-bundler/src/bundle/windows/mod.rs | 2 - .../tauri-bundler/src/bundle/windows/util.rs | 72 -------------- crates/tauri-bundler/src/error.rs | 10 +- crates/tauri-utils/src/platform.rs | 15 ++- 9 files changed, 131 insertions(+), 195 deletions(-) create mode 100644 .changes/fix-binary-patching.md create mode 100644 crates/tauri-bundler/src/bundle/kmp/mod.rs delete mode 100644 crates/tauri-bundler/src/bundle/linux/util.rs diff --git a/.changes/fix-binary-patching.md b/.changes/fix-binary-patching.md new file mode 100644 index 000000000..0778d600f --- /dev/null +++ b/.changes/fix-binary-patching.md @@ -0,0 +1,8 @@ +--- +"tauri": minor:changes +"tauri-cli": minor:changes +"tauri-bundler": minor:changes +"@tauri-apps/cli": minor:changes +--- + +Change the way bundle type information is added to binary files. Instead of looking up the value of a variable we simply look for the default value. diff --git a/crates/tauri-bundler/src/bundle.rs b/crates/tauri-bundler/src/bundle.rs index bac77c041..042a3dfb2 100644 --- a/crates/tauri-bundler/src/bundle.rs +++ b/crates/tauri-bundler/src/bundle.rs @@ -4,6 +4,8 @@ // SPDX-License-Identifier: MIT mod category; +#[cfg(any(target_os = "linux", target_os = "windows"))] +mod kmp; #[cfg(target_os = "linux")] mod linux; #[cfg(target_os = "macos")] @@ -15,29 +17,46 @@ mod windows; use tauri_utils::{display_path, platform::Target as TargetPlatform}; +#[cfg(any(target_os = "linux", target_os = "windows"))] +const BUNDLE_VAR_TOKEN: &[u8] = b"__TAURI_BUNDLE_TYPE_VAR_UNK"; /// Patch a binary with bundle type information +#[cfg(any(target_os = "linux", target_os = "windows"))] fn patch_binary(binary: &PathBuf, package_type: &PackageType) -> crate::Result<()> { - match package_type { - #[cfg(target_os = "linux")] - PackageType::AppImage | PackageType::Deb | PackageType::Rpm => { - log::info!( - "Patching binary {:?} for type {}", - binary, - package_type.short_name() - ); - linux::patch_binary(binary, package_type)?; - } - PackageType::Nsis | PackageType::WindowsMsi => { - log::info!( - "Patching binary {:?} for type {}", - binary, - package_type.short_name() - ); - windows::patch_binary(binary, package_type)?; - } - _ => (), - } + let mut file_data = std::fs::read(binary).expect("Could not read binary file."); + if let Some(bundle_var_index) = kmp::index_of(BUNDLE_VAR_TOKEN, &file_data) { + #[cfg(target_os = "linux")] + let bundle_type = match package_type { + crate::PackageType::Deb => b"__TAURI_BUNDLE_TYPE_VAR_DEB", + crate::PackageType::Rpm => b"__TAURI_BUNDLE_TYPE_VAR_RPM", + crate::PackageType::AppImage => b"__TAURI_BUNDLE_TYPE_VAR_APP", + _ => { + return Err(crate::Error::InvalidPackageType( + package_type.short_name().to_owned(), + "Linux".to_owned(), + )) + } + }; + #[cfg(target_os = "windows")] + let bundle_type = match package_type { + crate::PackageType::Nsis => b"__TAURI_BUNDLE_TYPE_VAR_NSS", + crate::PackageType::WindowsMsi => b"__TAURI_BUNDLE_TYPE_VAR_MSI", + _ => { + return Err(crate::Error::InvalidPackageType( + package_type.short_name().to_owned(), + "Windows".to_owned(), + )) + } + }; + + file_data[bundle_var_index..bundle_var_index + BUNDLE_VAR_TOKEN.len()] + .copy_from_slice(bundle_type); + + std::fs::write(binary, &file_data) + .map_err(|e| crate::Error::BinaryWriteError(e.to_string()))?; + } else { + return Err(crate::Error::MissingBundleTypeVar); + } Ok(()) } @@ -92,22 +111,17 @@ pub fn bundle_project(settings: &Settings) -> crate::Result> { .expect("Main binary missing in settings"); let main_binary_path = settings.binary_path(main_binary); - // When packaging multiple binary types, we make a copy of the unsigned main_binary so that we can - // restore it after each package_type step. This avoids two issues: + // We make a copy of the unsigned main_binary so that we can restore it after each package_type step. + // This allows us to patch the binary correctly and avoids two issues: // - modifying a signed binary without updating its PE checksum can break signature verification // - codesigning tools should handle calculating+updating this, we just need to ensure // (re)signing is performed after every `patch_binary()` operation // - signing an already-signed binary can result in multiple signatures, causing verification errors - let main_binary_reset_required = matches!(target_os, TargetPlatform::Windows) - && settings.windows().can_sign() - && package_types.len() > 1; - let mut unsigned_main_binary_copy = tempfile::tempfile()?; - if main_binary_reset_required { - let mut unsigned_main_binary = std::fs::File::open(&main_binary_path)?; - std::io::copy(&mut unsigned_main_binary, &mut unsigned_main_binary_copy)?; - } + // TODO: change this to work on a copy while preserving the main binary unchanged + let mut main_binary_copy = tempfile::tempfile()?; + let mut main_binary_orignal = std::fs::File::open(&main_binary_path)?; + std::io::copy(&mut main_binary_orignal, &mut main_binary_copy)?; - let mut main_binary_signed = false; let mut bundles = Vec::::new(); for package_type in &package_types { // bundle was already built! e.g. DMG already built .app @@ -115,22 +129,14 @@ pub fn bundle_project(settings: &Settings) -> crate::Result> { continue; } + #[cfg(any(target_os = "linux", target_os = "windows"))] if let Err(e) = patch_binary(&main_binary_path, package_type) { log::warn!("Failed to add bundler type to the binary: {e}. Updater plugin may not be able to update this package. This shouldn't normally happen, please report it to https://github.com/tauri-apps/tauri/issues"); } // sign main binary for every package type after patch if matches!(target_os, TargetPlatform::Windows) && settings.windows().can_sign() { - if main_binary_signed && main_binary_reset_required { - let mut signed_main_binary = std::fs::OpenOptions::new() - .write(true) - .truncate(true) - .open(&main_binary_path)?; - unsigned_main_binary_copy.seek(SeekFrom::Start(0))?; - std::io::copy(&mut unsigned_main_binary_copy, &mut signed_main_binary)?; - } windows::sign::try_sign(&main_binary_path, settings)?; - main_binary_signed = true; } let bundle_paths = match package_type { @@ -172,6 +178,14 @@ pub fn bundle_project(settings: &Settings) -> crate::Result> { package_type: package_type.to_owned(), bundle_paths, }); + + // Restore unsigned and unpatched binary + let mut modified_main_binary = std::fs::OpenOptions::new() + .write(true) + .truncate(true) + .open(&main_binary_path)?; + main_binary_copy.seek(SeekFrom::Start(0))?; + std::io::copy(&mut main_binary_copy, &mut modified_main_binary)?; } if let Some(updater) = settings.updater() { diff --git a/crates/tauri-bundler/src/bundle/kmp/mod.rs b/crates/tauri-bundler/src/bundle/kmp/mod.rs new file mode 100644 index 000000000..3e8489023 --- /dev/null +++ b/crates/tauri-bundler/src/bundle/kmp/mod.rs @@ -0,0 +1,61 @@ +// Copyright 2016-2019 Cargo-Bundle developers +// Copyright 2019-2024 Tauri Programme within The Commons Conservancy +// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: MIT + +// Knuth–Morris–Pratt algorithm +// based on https://github.com/howeih/rust_kmp +#[cfg(any(target_os = "linux", target_os = "windows"))] +pub fn index_of(pattern: &[u8], target: &[u8]) -> Option { + let failure_function = find_failure_function(pattern); + + let mut t_i: usize = 0; + let mut p_i: usize = 0; + let target_len = target.len(); + let mut result_idx = None; + let pattern_len = pattern.len(); + + while (t_i < target_len) && (p_i < pattern_len) { + if target[t_i] == pattern[p_i] { + if result_idx.is_none() { + result_idx.replace(t_i); + } + t_i += 1; + p_i += 1; + if p_i >= pattern_len { + return result_idx; + } + } else { + if p_i == 0 { + p_i = 0; + t_i += 1; + } else { + p_i = failure_function[p_i - 1]; + } + result_idx = None; + } + } + None +} + +#[cfg(any(target_os = "linux", target_os = "windows"))] +fn find_failure_function(pattern: &[u8]) -> Vec { + let mut i = 1; + let mut j = 0; + let pattern_length = pattern.len(); + let end_i = pattern_length - 1; + let mut failure_function = vec![0usize; pattern_length]; + while i <= end_i { + if pattern[i] == pattern[j] { + failure_function[i] = j + 1; + i += 1; + j += 1; + } else if j == 0 { + failure_function[i] = 0; + i += 1; + } else { + j = failure_function[j - 1]; + } + } + failure_function +} diff --git a/crates/tauri-bundler/src/bundle/linux/mod.rs b/crates/tauri-bundler/src/bundle/linux/mod.rs index ba66a8d39..8459b0528 100644 --- a/crates/tauri-bundler/src/bundle/linux/mod.rs +++ b/crates/tauri-bundler/src/bundle/linux/mod.rs @@ -7,8 +7,3 @@ pub mod appimage; pub mod debian; pub mod freedesktop; pub mod rpm; - -mod util; - -#[cfg(target_os = "linux")] -pub use util::patch_binary; diff --git a/crates/tauri-bundler/src/bundle/linux/util.rs b/crates/tauri-bundler/src/bundle/linux/util.rs deleted file mode 100644 index be1256295..000000000 --- a/crates/tauri-bundler/src/bundle/linux/util.rs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2019-2024 Tauri Programme within The Commons Conservancy -// SPDX-License-Identifier: Apache-2.0 -// SPDX-License-Identifier: MIT - -/// Change value of __TAURI_BUNDLE_TYPE static variable to mark which package type it was bundled in -#[cfg(target_os = "linux")] -pub fn patch_binary( - binary_path: &std::path::PathBuf, - package_type: &crate::PackageType, -) -> crate::Result<()> { - let mut file_data = std::fs::read(binary_path).expect("Could not read binary file."); - - let elf = match goblin::Object::parse(&file_data)? { - goblin::Object::Elf(elf) => elf, - _ => return Err(crate::Error::GenericError("Not an ELF file".to_owned())), - }; - - let offset = find_bundle_type_symbol(elf).ok_or(crate::Error::MissingBundleTypeVar)?; - let offset = offset as usize; - if offset + 3 <= file_data.len() { - let chars = &mut file_data[offset..offset + 3]; - match package_type { - crate::PackageType::Deb => chars.copy_from_slice(b"DEB"), - crate::PackageType::Rpm => chars.copy_from_slice(b"RPM"), - crate::PackageType::AppImage => chars.copy_from_slice(b"APP"), - _ => { - return Err(crate::Error::InvalidPackageType( - package_type.short_name().to_owned(), - "linux".to_owned(), - )) - } - } - - std::fs::write(binary_path, &file_data) - .map_err(|error| crate::Error::BinaryWriteError(error.to_string()))?; - } else { - return Err(crate::Error::BinaryOffsetOutOfRange); - } - - Ok(()) -} - -/// Find address of a symbol in relocations table -#[cfg(target_os = "linux")] -fn find_bundle_type_symbol(elf: goblin::elf::Elf<'_>) -> Option { - for sym in elf.syms.iter() { - if let Some(name) = elf.strtab.get_at(sym.st_name) { - if name == "__TAURI_BUNDLE_TYPE" { - for reloc in elf.dynrelas.iter() { - if reloc.r_offset == sym.st_value { - return Some(reloc.r_addend.unwrap()); - } - } - } - } - } - - None -} diff --git a/crates/tauri-bundler/src/bundle/windows/mod.rs b/crates/tauri-bundler/src/bundle/windows/mod.rs index 366e000e1..b92fb5f56 100644 --- a/crates/tauri-bundler/src/bundle/windows/mod.rs +++ b/crates/tauri-bundler/src/bundle/windows/mod.rs @@ -14,5 +14,3 @@ pub use util::{ NSIS_OUTPUT_FOLDER_NAME, NSIS_UPDATER_OUTPUT_FOLDER_NAME, WIX_OUTPUT_FOLDER_NAME, WIX_UPDATER_OUTPUT_FOLDER_NAME, }; - -pub use util::patch_binary; diff --git a/crates/tauri-bundler/src/bundle/windows/util.rs b/crates/tauri-bundler/src/bundle/windows/util.rs index 3685d0c06..55cfea3a9 100644 --- a/crates/tauri-bundler/src/bundle/windows/util.rs +++ b/crates/tauri-bundler/src/bundle/windows/util.rs @@ -77,75 +77,3 @@ pub fn os_bitness<'a>() -> Option<&'a str> { _ => None, } } - -pub fn patch_binary(binary_path: &PathBuf, package_type: &crate::PackageType) -> crate::Result<()> { - let mut file_data = std::fs::read(binary_path)?; - - let pe = match goblin::Object::parse(&file_data)? { - goblin::Object::PE(pe) => pe, - _ => { - return Err(crate::Error::BinaryParseError( - std::io::Error::new(std::io::ErrorKind::InvalidInput, "binary is not a PE file").into(), - )); - } - }; - - let tauri_bundle_section = pe - .sections - .iter() - .find(|s| s.name().unwrap_or_default() == ".taubndl") - .ok_or(crate::Error::MissingBundleTypeVar)?; - - let data_offset = tauri_bundle_section.pointer_to_raw_data as usize; - let pointer_size = if pe.is_64 { 8 } else { 4 }; - let ptr_bytes = file_data - .get(data_offset..data_offset + pointer_size) - .ok_or(crate::Error::BinaryOffsetOutOfRange)?; - // `try_into` is safe to `unwrap` here because we have already checked the slice's size through `get` - let ptr_value = if pe.is_64 { - u64::from_le_bytes(ptr_bytes.try_into().unwrap()) - } else { - u32::from_le_bytes(ptr_bytes.try_into().unwrap()).into() - }; - - let rdata_section = pe - .sections - .iter() - .find(|s| s.name().unwrap_or_default() == ".rdata") - .ok_or_else(|| { - crate::Error::BinaryParseError( - std::io::Error::new(std::io::ErrorKind::InvalidInput, ".rdata section not found").into(), - ) - })?; - - let rva = ptr_value.checked_sub(pe.image_base as u64).ok_or_else(|| { - crate::Error::BinaryParseError( - std::io::Error::new(std::io::ErrorKind::InvalidData, "invalid RVA offset").into(), - ) - })?; - - // see "Relative virtual address (RVA)" for explanation of offset arithmetic here: - // https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#general-concepts - let file_offset = rdata_section.pointer_to_raw_data as usize - + (rva as usize).saturating_sub(rdata_section.virtual_address as usize); - - // Overwrite the string at that offset - let string_bytes = file_data - .get_mut(file_offset..file_offset + 3) - .ok_or(crate::Error::BinaryOffsetOutOfRange)?; - match package_type { - crate::PackageType::Nsis => string_bytes.copy_from_slice(b"NSS"), - crate::PackageType::WindowsMsi => string_bytes.copy_from_slice(b"MSI"), - _ => { - return Err(crate::Error::InvalidPackageType( - package_type.short_name().to_owned(), - "windows".to_owned(), - )); - } - } - - std::fs::write(binary_path, &file_data) - .map_err(|e| crate::Error::BinaryWriteError(e.to_string()))?; - - Ok(()) -} diff --git a/crates/tauri-bundler/src/error.rs b/crates/tauri-bundler/src/error.rs index 518cb6ca9..40547a3ee 100644 --- a/crates/tauri-bundler/src/error.rs +++ b/crates/tauri-bundler/src/error.rs @@ -99,19 +99,13 @@ pub enum Error { #[error("Wrong package type {0} for platform {1}")] InvalidPackageType(String, String), /// Bundle type symbol missing in binary - #[cfg_attr( - target_os = "linux", - error("__TAURI_BUNDLE_TYPE variable not found in binary. Make sure tauri crate and tauri-cli are up to date and that symbol stripping is disabled (https://doc.rust-lang.org/cargo/reference/profiles.html#strip)") - )] - #[cfg_attr( - not(target_os = "linux"), - error("__TAURI_BUNDLE_TYPE variable not found in binary. Make sure tauri crate and tauri-cli are up to date") - )] + #[error("__TAURI_BUNDLE_TYPE variable not found in binary. Make sure tauri crate and tauri-cli are up to date")] MissingBundleTypeVar, /// Failed to write binary file changed #[error("Failed to write binary file changes: `{0}`")] BinaryWriteError(String), /// Invalid offset while patching binary file + #[deprecated] #[error("Invalid offset while patching binary file")] BinaryOffsetOutOfRange, /// Unsupported architecture. diff --git a/crates/tauri-utils/src/platform.rs b/crates/tauri-utils/src/platform.rs index 2ace45790..6eaaf3ffe 100644 --- a/crates/tauri-utils/src/platform.rs +++ b/crates/tauri-utils/src/platform.rs @@ -344,23 +344,20 @@ fn resource_dir_from>( // Variable holding the type of bundle the executable is stored in. This is modified by binary // patching during build #[used] -#[no_mangle] -#[cfg_attr(not(target_vendor = "apple"), link_section = ".taubndl")] -#[cfg_attr(target_vendor = "apple", link_section = "__DATA,taubndl")] // Marked as `mut` because it could get optimized away without it, // see https://github.com/tauri-apps/tauri/pull/13812 -static mut __TAURI_BUNDLE_TYPE: &str = "UNK"; +static mut __TAURI_BUNDLE_TYPE: &str = "__TAURI_BUNDLE_TYPE_VAR_UNK"; /// Get the type of the bundle current binary is packaged in. /// If the bundle type is unknown, it returns [`Option::None`]. pub fn bundle_type() -> Option { unsafe { match __TAURI_BUNDLE_TYPE { - "DEB" => Some(BundleType::Deb), - "RPM" => Some(BundleType::Rpm), - "APP" => Some(BundleType::AppImage), - "MSI" => Some(BundleType::Msi), - "NSS" => Some(BundleType::Nsis), + "__TAURI_BUNDLE_TYPE_VAR_DEB" => Some(BundleType::Deb), + "__TAURI_BUNDLE_TYPE_VAR_RPM" => Some(BundleType::Rpm), + "__TAURI_BUNDLE_TYPE_VAR_APP" => Some(BundleType::AppImage), + "__TAURI_BUNDLE_TYPE_VAR_MSI" => Some(BundleType::Msi), + "__TAURI_BUNDLE_TYPE_VAR_NSS" => Some(BundleType::Nsis), _ => { if cfg!(target_os = "macos") { Some(BundleType::App) From e919a760edfc115f9e4b5d841e29cc38d5535ed1 Mon Sep 17 00:00:00 2001 From: Luke Date: Mon, 19 Jan 2026 12:38:37 +0900 Subject: [PATCH 52/57] feat(webview-window): add set_simple_fullscreen to WebviewWindow (#14619) * feat(webview): add set_simple_fullscreen to WebviewWindow * add changes * Combine per platform fn to one --------- Co-authored-by: Tony --- .changes/webview-set-simple-fullscreen.md | 7 +++++ crates/tauri/src/webview/mod.rs | 21 +++++++++++++ crates/tauri/src/webview/webview_window.rs | 14 +++++++++ crates/tauri/src/window/mod.rs | 36 ++++++++++++---------- 4 files changed, 61 insertions(+), 17 deletions(-) create mode 100644 .changes/webview-set-simple-fullscreen.md diff --git a/.changes/webview-set-simple-fullscreen.md b/.changes/webview-set-simple-fullscreen.md new file mode 100644 index 000000000..ba0cdf8bf --- /dev/null +++ b/.changes/webview-set-simple-fullscreen.md @@ -0,0 +1,7 @@ +--- +'tauri': 'minor:feat' +--- + +Add `set_simple_fullscreen` method to `WebviewWindow`. + +This method was already available on the `Window` type and is now also available on `WebviewWindow` for consistency. On macOS, it toggles fullscreen mode without creating a new macOS Space. On other platforms, it falls back to regular fullscreen. diff --git a/crates/tauri/src/webview/mod.rs b/crates/tauri/src/webview/mod.rs index 4df09182a..8842382bf 100644 --- a/crates/tauri/src/webview/mod.rs +++ b/crates/tauri/src/webview/mod.rs @@ -2312,4 +2312,25 @@ mod tests { crate::test_utils::assert_send::(); crate::test_utils::assert_sync::(); } + + #[cfg(target_os = "macos")] + #[test] + fn test_webview_window_has_set_simple_fullscreen_method() { + use crate::test::{mock_builder, mock_context, noop_assets}; + + // Create a mock app with proper context + let app = mock_builder().build(mock_context(noop_assets())).unwrap(); + + // Get or create a webview window + let webview_window = + crate::WebviewWindowBuilder::new(&app, "test", crate::WebviewUrl::default()) + .build() + .unwrap(); + + // This should compile if set_simple_fullscreen exists + let result = webview_window.set_simple_fullscreen(true); + + // We expect this to work without panicking + assert!(result.is_ok(), "set_simple_fullscreen should succeed"); + } } diff --git a/crates/tauri/src/webview/webview_window.rs b/crates/tauri/src/webview/webview_window.rs index 92b033b06..290730067 100644 --- a/crates/tauri/src/webview/webview_window.rs +++ b/crates/tauri/src/webview/webview_window.rs @@ -2057,6 +2057,20 @@ impl WebviewWindow { self.window.set_fullscreen(fullscreen) } + /// Toggles a fullscreen mode that doesn't require a new macOS space. + /// Returns a boolean indicating whether the transition was successful (this won't work if the window was already in the native fullscreen). + /// + /// This is how fullscreen used to work on macOS in versions before Lion. + /// And allows the user to have a fullscreen window without using another space or taking control over the entire monitor. + /// + /// ## Platform-specific + /// + /// - **macOS:** Uses native simple fullscreen mode. + /// - **Other platforms:** Falls back to [`Self::set_fullscreen`]. + pub fn set_simple_fullscreen(&self, enable: bool) -> crate::Result<()> { + self.window.set_simple_fullscreen(enable) + } + /// Bring the window to front and focus. pub fn set_focus(&self) -> crate::Result<()> { self.window.set_focus() diff --git a/crates/tauri/src/window/mod.rs b/crates/tauri/src/window/mod.rs index a67784cc3..47c95628b 100644 --- a/crates/tauri/src/window/mod.rs +++ b/crates/tauri/src/window/mod.rs @@ -1968,25 +1968,27 @@ tauri::Builder::default() .map_err(Into::into) } - /// Toggles a fullscreen mode that doesn’t require a new macOS space. Returns a boolean indicating whether the transition was successful (this won’t work if the window was already in the native fullscreen). + /// Toggles a fullscreen mode that doesn't require a new macOS space. + /// Returns a boolean indicating whether the transition was successful (this won't work if the window was already in the native fullscreen). /// - /// This is how fullscreen used to work on macOS in versions before Lion. And allows the user to have a fullscreen window without using another space or taking control over the entire monitor. - #[cfg(target_os = "macos")] + /// This is how fullscreen used to work on macOS in versions before Lion. + /// And allows the user to have a fullscreen window without using another space or taking control over the entire monitor. + /// + /// ## Platform-specific + /// + /// - **macOS:** Uses native simple fullscreen mode. + /// - **Other platforms:** Falls back to [`Self::set_fullscreen`]. pub fn set_simple_fullscreen(&self, enable: bool) -> crate::Result<()> { - self - .window - .dispatcher - .set_simple_fullscreen(enable) - .map_err(Into::into) - } - - /// On macOS, Toggles a fullscreen mode that doesn’t require a new macOS space. Returns a boolean indicating whether the transition was successful (this won’t work if the window was already in the native fullscreen). - /// This is how fullscreen used to work on macOS in versions before Lion. And allows the user to have a fullscreen window without using another space or taking control over the entire monitor. - /// - /// On other platforms, this is the same as [`Window#method.set_fullscreen`]. - #[cfg(not(target_os = "macos"))] - pub fn set_simple_fullscreen(&self, fullscreen: bool) -> crate::Result<()> { - self.set_fullscreen(fullscreen) + #[cfg(target_os = "macos")] + { + self + .window + .dispatcher + .set_simple_fullscreen(enable) + .map_err(Into::into) + } + #[cfg(not(target_os = "macos"))] + self.set_fullscreen(enable) } /// Bring the window to front and focus. From 62aa13a124ef46bb5ce9887a2a574dd35ef86d4f Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Mon, 19 Jan 2026 16:32:43 -0300 Subject: [PATCH 53/57] fix(cli): Android build --apk and --aab flags requiring a value (#14629) Co-authored-by: Fabian-Lars --- .changes/fix-android-bundle-flag.md | 6 ++++++ crates/tauri-cli/src/mobile/android/build.rs | 16 +++++++++------- crates/tauri-cli/src/mobile/android/run.rs | 5 +++-- 3 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 .changes/fix-android-bundle-flag.md diff --git a/.changes/fix-android-bundle-flag.md b/.changes/fix-android-bundle-flag.md new file mode 100644 index 000000000..1fc06e69e --- /dev/null +++ b/.changes/fix-android-bundle-flag.md @@ -0,0 +1,6 @@ +--- +"tauri-cli": patch:bug +"@tauri-apps/cli": patch:bug +--- + +Fix `android build`'s `--aab` and `--apk` flags requiring a value to be provided. diff --git a/crates/tauri-cli/src/mobile/android/build.rs b/crates/tauri-cli/src/mobile/android/build.rs index 5e5e7cd62..7b85ef47d 100644 --- a/crates/tauri-cli/src/mobile/android/build.rs +++ b/crates/tauri-cli/src/mobile/android/build.rs @@ -64,10 +64,12 @@ pub struct Options { pub split_per_abi: bool, /// Build APKs. #[clap(long)] - pub apk: Option, + pub apk: bool, /// Build AABs. #[clap(long)] - pub aab: Option, + pub aab: bool, + #[clap(skip)] + pub skip_bundle: bool, /// Open Android Studio #[clap(short, long)] pub open: bool, @@ -242,10 +244,10 @@ fn run_build( noise_level: NoiseLevel, tauri_dir: &Path, ) -> Result { - if !(options.apk.is_some() || options.aab.is_some()) { + if !(options.skip_bundle || options.apk || options.aab) { // if the user didn't specify the format to build, we'll do both - options.apk = Some(true); - options.aab = Some(true); + options.apk = true; + options.aab = true; } let interface_options = InterfaceOptions { @@ -272,7 +274,7 @@ fn run_build( inject_resources(config, tauri_config)?; - let apk_outputs = if options.apk.unwrap_or_default() { + let apk_outputs = if options.apk { apk::build( config, env, @@ -286,7 +288,7 @@ fn run_build( Vec::new() }; - let aab_outputs = if options.aab.unwrap_or_default() { + let aab_outputs = if options.aab { aab::build( config, env, diff --git a/crates/tauri-cli/src/mobile/android/run.rs b/crates/tauri-cli/src/mobile/android/run.rs index 736ca84d6..c07c6ba6d 100644 --- a/crates/tauri-cli/src/mobile/android/run.rs +++ b/crates/tauri-cli/src/mobile/android/run.rs @@ -101,8 +101,9 @@ pub fn command(options: Options, noise_level: NoiseLevel) -> Result<()> { features: options.features, config: options.config.clone(), split_per_abi: true, - apk: Some(false), - aab: Some(false), + apk: false, + aab: false, + skip_bundle: false, open: options.open, ci: false, args: options.args, From 53611c4d7bdaf89b9a5d7c46a9c4bf4e34216148 Mon Sep 17 00:00:00 2001 From: Tony <68118705+Legend-Master@users.noreply.github.com> Date: Tue, 20 Jan 2026 17:52:34 +0800 Subject: [PATCH 54/57] fix(cli): only watch dependent workspace members (#14747) * fix(cli): only watch dependent workspace members * Use manifest path instead of `workspace_default_members` * Add change file * Merge remote-tracking branch 'upstream/dev' into only-watch-dependencies * `bug` not `fix` * Merge branch 'dev' into only-watch-dependencies * Remove `CargoMetadataExpended` * Merge remote-tracking branch 'upstream/dev' into only-watch-dependencies * Remove top level `.taurignore` * Load ignore files from workspace root --- .changes/only-watch-dependencies.md | 6 ++ .taurignore | 16 ---- crates/tauri-cli/src/interface/rust.rs | 123 ++++++++++++++++--------- 3 files changed, 88 insertions(+), 57 deletions(-) create mode 100644 .changes/only-watch-dependencies.md delete mode 100644 .taurignore diff --git a/.changes/only-watch-dependencies.md b/.changes/only-watch-dependencies.md new file mode 100644 index 000000000..e638cb591 --- /dev/null +++ b/.changes/only-watch-dependencies.md @@ -0,0 +1,6 @@ +--- +"@tauri-apps/cli": patch:bug +"tauri-cli": patch:bug +--- + +Only watch dependent workspace members when running `tauri dev` instead of watching on all members diff --git a/.taurignore b/.taurignore deleted file mode 100644 index 6e49b1ea8..000000000 --- a/.taurignore +++ /dev/null @@ -1,16 +0,0 @@ -.changes -.devcontainer -.docker -.github -.scripts -.vscode -audits -bench -packages/api -packages/cli -crates/tauri-cli -crates/tauri-bundler -crates/tauri-driver -crates/tauri-macos-sign -crates/tauri-schema-generator -crates/tests diff --git a/crates/tauri-cli/src/interface/rust.rs b/crates/tauri-cli/src/interface/rust.rs index a960ecc9a..3878b8845 100644 --- a/crates/tauri-cli/src/interface/rust.rs +++ b/crates/tauri-cli/src/interface/rust.rs @@ -7,6 +7,7 @@ use std::{ ffi::OsStr, fs::FileType, io::{BufRead, Write}, + iter::once, path::{Path, PathBuf}, process::Command, str::FromStr, @@ -15,7 +16,6 @@ use std::{ }; use dunce::canonicalize; -use glob::glob; use ignore::gitignore::{Gitignore, GitignoreBuilder}; use notify::RecursiveMode; use notify_debouncer_full::new_debouncer; @@ -449,25 +449,15 @@ fn dev_options( } } -// Copied from https://github.com/rust-lang/cargo/blob/69255bb10de7f74511b5cef900a9d102247b6029/src/cargo/core/workspace.rs#L665 -fn expand_member_path(path: &Path) -> crate::Result> { - let path = path.to_str().context("path is not UTF-8 compatible")?; - let res = glob(path).with_context(|| format!("failed to expand glob pattern for {path}"))?; - let res = res - .map(|p| p.with_context(|| format!("failed to expand glob pattern for {path}"))) - .collect::, _>>()?; - Ok(res) -} - fn get_watch_folders( additional_watch_folders: &[PathBuf], tauri_dir: &Path, ) -> crate::Result> { - let workspace_path = get_workspace_dir(tauri_dir)?; - // We always want to watch the main tauri folder. let mut watch_folders = vec![tauri_dir.to_path_buf()]; + watch_folders.extend(get_in_workspace_dependency_paths(tauri_dir)?); + // Add the additional watch folders, resolving the path from the tauri path if it is relative watch_folders.extend(additional_watch_folders.iter().filter_map(|dir| { let path = if dir.is_absolute() { @@ -486,30 +476,6 @@ fn get_watch_folders( canonicalized })); - // We also try to watch workspace members, no matter if the tauri cargo project is the workspace root or a workspace member - let cargo_settings = CargoSettings::load(&workspace_path)?; - if let Some(members) = cargo_settings.workspace.and_then(|w| w.members) { - for p in members { - let p = workspace_path.join(p); - match expand_member_path(&p) { - // Sometimes expand_member_path returns an empty vec, for example if the path contains `[]` as in `C:/[abc]/project/`. - // Cargo won't complain unless theres a workspace.members config with glob patterns so we should support it too. - Ok(expanded_paths) => { - if expanded_paths.is_empty() { - watch_folders.push(p); - } else { - watch_folders.extend(expanded_paths); - } - } - Err(err) => { - // If this fails cargo itself should fail too. But we still try to keep going with the unexpanded path. - log::error!("Error watching {}: {}", p.display(), err); - watch_folders.push(p); - } - }; - } - } - Ok(watch_folders) } @@ -556,8 +522,13 @@ impl Rust { let watch_folders = get_watch_folders(additional_watch_folders, dirs.tauri)?; - let common_ancestor = common_path::common_path_all(watch_folders.iter().map(Path::new)) - .expect("watch_folders should not be empty"); + let common_ancestor = common_path::common_path_all( + watch_folders + .iter() + .map(Path::new) + .chain(once(self.app_settings.workspace_dir.as_path())), + ) + .expect("watch_folders should not be empty"); let ignore_matcher = build_ignore_matcher(&common_ancestor); let mut watcher = new_debouncer(Duration::from_secs(1), None, move |r| { @@ -692,7 +663,7 @@ pub struct TomlWorkspaceField { #[derive(Clone, Debug, Deserialize)] struct WorkspaceSettings { /// the workspace members. - members: Option>, + // members: Option>, package: Option, } @@ -779,6 +750,7 @@ pub struct RustAppSettings { cargo_config: CargoConfig, target_triple: String, target_platform: TargetPlatform, + workspace_dir: PathBuf, } #[derive(Deserialize)] @@ -1096,7 +1068,8 @@ impl RustAppSettings { } }; - let ws_package_settings = CargoSettings::load(&get_workspace_dir(tauri_dir)?) + let workspace_dir = get_workspace_dir(tauri_dir)?; + let ws_package_settings = CargoSettings::load(&workspace_dir) .context("failed to load Cargo settings from workspace root")? .workspace .and_then(|v| v.package); @@ -1191,6 +1164,7 @@ impl RustAppSettings { cargo_config, target_triple, target_platform, + workspace_dir, }) } @@ -1210,6 +1184,23 @@ impl RustAppSettings { pub(crate) struct CargoMetadata { pub(crate) target_directory: PathBuf, pub(crate) workspace_root: PathBuf, + workspace_members: Vec, + packages: Vec, +} + +#[derive(Deserialize)] +struct Package { + name: String, + id: String, + manifest_path: PathBuf, + dependencies: Vec, +} + +#[derive(Deserialize)] +struct Dependency { + name: String, + /// Local package + path: Option, } pub(crate) fn get_cargo_metadata(tauri_dir: &Path) -> crate::Result { @@ -1232,6 +1223,56 @@ pub(crate) fn get_cargo_metadata(tauri_dir: &Path) -> crate::Result crate::Result> { + let metadata = get_cargo_metadata(tauri_dir)?; + let tauri_project_manifest_path = tauri_dir.join("Cargo.toml"); + let tauri_project_package = metadata + .packages + .iter() + .find(|package| package.manifest_path == tauri_project_manifest_path) + .context("tauri project package doesn't exist in cargo metadata output `packages`")?; + + let workspace_packages = metadata + .workspace_members + .iter() + .map(|member_package_id| { + metadata + .packages + .iter() + .find(|package| package.id == *member_package_id) + .context("workspace member doesn't exist in cargo metadata output `packages`") + }) + .collect::>>()?; + + let mut found_dependency_paths = Vec::new(); + find_dependencies( + tauri_project_package, + &workspace_packages, + &mut found_dependency_paths, + ); + Ok(found_dependency_paths) +} + +fn find_dependencies( + package: &Package, + workspace_packages: &Vec<&Package>, + found_dependency_paths: &mut Vec, +) { + for dependency in &package.dependencies { + if let Some(path) = &dependency.path { + if let Some(package) = workspace_packages.iter().find(|workspace_package| { + workspace_package.name == dependency.name + && path.join("Cargo.toml") == workspace_package.manifest_path + && !found_dependency_paths.contains(path) + }) { + found_dependency_paths.push(path.to_owned()); + find_dependencies(package, workspace_packages, found_dependency_paths); + } + } + } +} + /// Get the cargo target directory based on the provided arguments. /// If "--target-dir" is specified in args, use it as the target directory (relative to current directory). /// Otherwise, use the target directory from cargo metadata. From 853ed4642ff77154ccd380dd9289d90815d42691 Mon Sep 17 00:00:00 2001 From: Ishita Singh Date: Wed, 21 Jan 2026 02:22:11 +0530 Subject: [PATCH 55/57] fix(android): improve error handling for external storage file access (#14442) Co-authored-by: Fabian-Lars --- .changes/android-external-files-fix.md | 5 +++++ crates/tauri/src/protocol/asset.rs | 24 ++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 .changes/android-external-files-fix.md diff --git a/.changes/android-external-files-fix.md b/.changes/android-external-files-fix.md new file mode 100644 index 000000000..b6c2a1446 --- /dev/null +++ b/.changes/android-external-files-fix.md @@ -0,0 +1,5 @@ +--- +"tauri": patch:bug +--- + +Fixed 500 error when accessing local video files in Android external storage directory via `convertFileSrc`. Added better error handling and logging for Android external storage access to help diagnose permission and accessibility issues. \ No newline at end of file diff --git a/crates/tauri/src/protocol/asset.rs b/crates/tauri/src/protocol/asset.rs index a5007d294..e7c713324 100644 --- a/crates/tauri/src/protocol/asset.rs +++ b/crates/tauri/src/protocol/asset.rs @@ -48,9 +48,29 @@ fn get_response( return resp.status(403).body(Vec::new().into()).map_err(Into::into); } - let (mut file, len, mime_type, read_bytes) = crate::async_runtime::safe_block_on(async move { - let mut file = File::open(&path).await?; + // Separate block for easier error handling + let mut file = match crate::async_runtime::safe_block_on(File::open(path.clone())) { + Ok(file) => file, + Err(e) => { + #[cfg(target_os = "android")] + { + if path.starts_with("/storage/emulated/0/Android/data/") { + log::error!("Failed to open Android external storage file '{}': {}. This may be due to missing storage permissions.", path, e); + } + } + return if e.kind() == std::io::ErrorKind::NotFound { + log::error!("File does not exist at path: {}", path); + return resp.status(404).body(Vec::new().into()).map_err(Into::into); + } else if e.kind() == std::io::ErrorKind::PermissionDenied { + log::error!("Missing OS permission to access path \"{}\": {}", path, e); + return resp.status(403).body(Vec::new().into()).map_err(Into::into); + } else { + Err(e.into()) + }; + } + }; + let (mut file, len, mime_type, read_bytes) = crate::async_runtime::safe_block_on(async move { // get file length let len = { let old_pos = file.stream_position().await?; From f82594410cd57d6f794f58d4afea0ed335aa796f Mon Sep 17 00:00:00 2001 From: Quentin Goinaud Date: Tue, 20 Jan 2026 22:19:05 +0100 Subject: [PATCH 56/57] feat(cli): allow electron to start tauri (#13253) Co-authored-by: Lucas Fernandes Nogueira --- .changes/change-pr-13253.md | 6 ++++++ packages/cli/tauri.js | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changes/change-pr-13253.md diff --git a/.changes/change-pr-13253.md b/.changes/change-pr-13253.md new file mode 100644 index 000000000..e42a66072 --- /dev/null +++ b/.changes/change-pr-13253.md @@ -0,0 +1,6 @@ +--- +"@tauri-apps/cli": patch:enhance +"tauri-cli": patch:enhance +--- + +Allow electron to run the CLI directly diff --git a/packages/cli/tauri.js b/packages/cli/tauri.js index d0460573b..452202cbb 100644 --- a/packages/cli/tauri.js +++ b/packages/cli/tauri.js @@ -20,7 +20,7 @@ if (globalThis.navigator?.userAgent?.includes('Deno')) { } // Even if started by a package manager, the binary will be NodeJS. // Some distribution still use "nodejs" as the binary name. -else if (binStem.match(/(nodejs|node|bun)\-?([0-9]*)*$/g)) { +else if (binStem.match(/(nodejs|node|bun|electron)\-?([0-9]*)*$/g)) { const managerStem = process.env.npm_execpath ? path.parse(process.env.npm_execpath).name.toLowerCase() : null From c862a0bd8c30a7b5454d3c54a1b7a81ddb1ef1a5 Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Wed, 21 Jan 2026 03:42:15 +0100 Subject: [PATCH 57/57] fix(core): update error wording for invalid version field (#14800) * fix(core): update error wording for invalid version field fixes #14799 * fmt --- crates/tauri-utils/src/config.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/tauri-utils/src/config.rs b/crates/tauri-utils/src/config.rs index 4350398d0..8826e3f51 100644 --- a/crates/tauri-utils/src/config.rs +++ b/crates/tauri-utils/src/config.rs @@ -3164,18 +3164,20 @@ impl<'d> serde::Deserialize<'d> for PackageVersion { })?; Ok(PackageVersion( Version::from_str(version) - .map_err(|_| DeError::custom("`package > version` must be a semver string"))? + .map_err(|_| { + DeError::custom("`tauri.conf.json > version` must be a semver string") + })? .to_string(), )) } else { Err(DeError::custom( - "`package > version` value is not a path to a JSON object", + "`tauri.conf.json > version` value is not a path to a JSON object", )) } } else { Ok(PackageVersion( Version::from_str(value) - .map_err(|_| DeError::custom("`package > version` must be a semver string"))? + .map_err(|_| DeError::custom("`tauri.conf.json > version` must be a semver string"))? .to_string(), )) }