CLI self-updater, warn on version mismatch, direct install.sh option, androidmanifest and info.plist customization, bump to 0.7-alpha.0 (#4095)

* wip.... bun installer

* - warn on incompatible versions
- clean up some logs
- add coloring to log levels

* add toasts to desktop/mobile

* Auto open simulators

* auto boot android

* preserve url

* pull out some of the warnings

* add self-updater

* wip: mcp

* add install.sh and adjust binstall path

* add some cuter styling to logs!

* update "input.css"

* update other input.css

* style a bit more

* change getting started

* add windows installer

* move dioxus-mobile into dioxus-desktop
add sentry wip to cli

* shorten timeout of toast

* fix cli display

* wire up customization of android manifest

* udid is a real word

* add 429 to lychee cache

* accept all 200-204 and 429
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2025-05-14 08:43:11 +02:00
1 parent 53ef78823d
commit 4d3d55a7a3
56 files changed
+1560 -548

No files matched your search

+56
View File
@@ -0,0 +1,56 @@
#!/usr/bin/env pwsh
$ErrorActionPreference = 'Stop'
if ($v) {
$Version = "v${v}"
}
if ($Args.Length -eq 1) {
$Version = $Args.Get(0)
}
$DxInstall = $env:DX_INSTALL
$BinDir = if ($DxInstall) {
"${DxInstall}\bin"
} else {
"${Home}\.dx\bin"
}
$DxZip = "$BinDir\dx.zip"
$DxExe = "$BinDir\dx.exe"
$Target = 'x86_64-pc-windows-msvc'
$DownloadUrl = if (!$Version) {
"https://github.com/dioxuslabs/dioxus/releases/latest/download/dx-${target}.zip"
} else {
"https://github.com/dioxuslabs/dioxus/releases/download/${Version}/dx-${target}.zip"
}
if (!(Test-Path $BinDir)) {
New-Item $BinDir -ItemType Directory | Out-Null
}
curl.exe --ssl-revoke-best-effort -Lo $DxZip $DownloadUrl
tar.exe xf $DxZip -C $BinDir
Remove-Item $DxZip
$CargoBin = "${Home}\.cargo\bin"
if (!(Test-Path $CargoBin)) {
New-Item $CargoBin -ItemType Directory | Out-Null
}
Copy-Item $DxExe "$CargoBin\dx.exe" -Force
# $User = [System.EnvironmentVariableTarget]::User
# $Path = [System.Environment]::GetEnvironmentVariable('Path', $User)
# if (!(";${Path};".ToLower() -like "*;${BinDir};*".ToLower())) {
# [System.Environment]::SetEnvironmentVariable('Path', "${Path};${BinDir}", $User)
# $Env:Path += ";${BinDir}"
# }
Write-Output "dx was installed successfully! 💫"
Write-Output "Run 'dx --help' to get started"
+104
View File
@@ -0,0 +1,104 @@
#!/bin/sh
set -eo pipefail
# Reset
Color_Off=''
# Regular Colors
Red=''
Green=''
Dim='' # White
# Bold
Bold_White=''
Bold_Green=''
if [[ -t 1 ]]; then
# Reset
Color_Off='\033[0m' # Text Reset
# Regular Colors
Red='\033[0;31m' # Red
Green='\033[0;32m' # Green
Dim='\033[0;2m' # White
# Bold
Bold_Green='\033[1;32m' # Bold Green
Bold_White='\033[1m' # Bold White
fi
error() {
echo -e "${Red}error${Color_Off}:" "$@" >&2
exit 1
}
info() {
echo -e "${Dim}$@ ${Color_Off}"
}
info_bold() {
echo -e "${Bold_White}$@ ${Color_Off}"
}
success() {
echo -e "${Green}$@ ${Color_Off}"
}
command -v unzip >/dev/null ||
error 'unzip is required to install dx'
if [[ $# -gt 1 ]]; then
error 'Too many arguments, only 1 are allowed. The first can be a specific tag of dx to install. (e.g. "dx-v0.7.1")'
fi
if [ "$OS" = "Windows_NT" ]; then
target="x86_64-pc-windows-msvc"
else
case $(uname -sm) in
"Darwin x86_64") target="x86_64-apple-darwin" ;;
"Darwin arm64") target="aarch64-apple-darwin" ;;
"Linux aarch64") target="aarch64-unknown-linux-gnu" ;;
*) target="x86_64-unknown-linux-gnu" ;;
esac
fi
GITHUB=${GITHUB-"https://github.com"}
github_repo="$GITHUB/dioxuslabs/dioxus"
exe_name=dx
if [[ $# = 0 ]]; then
dx_uri=$github_repo/releases/latest/download/dx-$target.zip
else
dx_uri=$github_repo/releases/download/$1/dx-$target.zip
fi
dx_install="${DX_INSTALL:-$HOME/.dx}"
bin_dir="$dx_install/bin"
exe="$bin_dir/dx"
cargo_bin_dir="$HOME/.cargo/bin"
cargo_bin_exe="$cargo_bin_dir/dx"
if [ ! -d "$bin_dir" ]; then
mkdir -p "$bin_dir"
fi
curl --fail --location --progress-bar --output "$exe.zip" "$dx_uri"
if command -v unzip >/dev/null; then
unzip -d "$bin_dir" -o "$exe.zip"
else
7z x -o"$bin_dir" -y "$exe.zip"
fi
chmod +x "$exe"
cp "$exe" "$cargo_bin_exe" || error "Failed to copy dx to $cargo_bin_dir"
rm "$exe.zip"
echo " installed: $cargo_bin_exe"
echo
echo "dx was installed successfully! 💫"
echo
if command -v dx >/dev/null; then
echo "Run 'dx --help' to get started"
else
echo "Run '$exe --help' to get started"
fi
+1 -1
View File
@@ -98,7 +98,7 @@ jobs:
bin: dx
token: ${{ secrets.GITHUB_TOKEN }}
target: ${{ matrix.platform.target }}
archive: $bin-$target-${{ env.RELEASE_TAG }}
archive: $bin-$target
checksum: sha256
manifest_path: packages/cli/Cargo.toml
ref: refs/tags/${{ env.RELEASE_POST }}