#!/usr/bin/env bash set -euo pipefail if [[ ${OS:-} = Windows_NT ]]; then echo 'error: Please install bun using Windows Subsystem for Linux' exit 1 fi # 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 bun (see: https://github.com/oven-sh/bun#unzip-is-required)' if [[ $# -gt 2 ]]; then error 'Too many arguments, only 2 are allowed. The first can be a specific tag of bun to install. (e.g. "bun-v0.1.4") The second can be a build variant of bun to install. (e.g. "debug-info")' fi case $(uname -ms) in 'Darwin x86_64') target=darwin-x64 ;; 'Darwin arm64') target=darwin-aarch64 ;; 'Linux aarch64' | 'Linux arm64') target=linux-aarch64 ;; 'Linux x86_64' | *) target=linux-x64 ;; esac if [[ $target = darwin-x64 ]]; then # Is this process running in Rosetta? # redirect stderr to devnull to avoid error message when not running in Rosetta if [[ $(sysctl -n sysctl.proc_translated 2>/dev/null) = 1 ]]; then target=darwin-aarch64 info "Your shell is running in Rosetta 2. Downloading bun for $target instead" fi fi GITHUB=${GITHUB-"https://github.com"} github_repo="$GITHUB/oven-sh/bun" if [[ $target = darwin-x64 ]]; then # If AVX2 isn't supported, use the -baseline build if [[ $(sysctl -a | grep machdep.cpu | grep AVX2) == '' ]]; then target=darwin-x64-baseline fi fi if [[ $target = linux-x64 ]]; then # If AVX2 isn't supported, use the -baseline build if [[ $(cat /proc/cpuinfo | grep avx2) = '' ]]; then target=linux-x64-baseline fi fi exe_name=bun if [[ $# = 2 && $2 = debug-info ]]; then target=$target-profile exe_name=bun-profile info "You requested a debug build of bun. More infomation will be shown if a crash occurs." fi if [[ $# = 0 ]]; then bun_uri=$github_repo/releases/latest/download/bun-$target.zip else bun_uri=$github_repo/releases/download/$1/bun-$target.zip fi install_env=BUN_INSTALL bin_env=\$$install_env/bin install_dir=${!install_env:-$HOME/.bun} bin_dir=$install_dir/bin exe=$bin_dir/bun if [[ ! -d $bin_dir ]]; then mkdir -p "$bin_dir" || error "Failed to create install directory \"$bin_dir\"" fi curl --fail --location --progress-bar --output "$exe.zip" "$bun_uri" || error "Failed to download bun from \"$bun_uri\"" unzip -oqd "$bin_dir" "$exe.zip" || error 'Failed to extract bun' mv "$bin_dir/bun-$target/$exe_name" "$exe" || error 'Failed to move extracted bun to destination' chmod +x "$exe" || error 'Failed to set permissions on bun executable' rm -r "$bin_dir/bun-$target" "$exe.zip" tildify() { if [[ $1 = $HOME/* ]]; then local replacement=\~/ echo "${1/$HOME\//$replacement}" else echo "$1" fi } success "bun was installed successfully to $Bold_Green$(tildify "$exe")" if command -v bun >/dev/null; then # Install completions, but we don't care if it fails IS_BUN_AUTO_UPDATE=true $exe completions &>/dev/null || : echo "Run 'bun --help' to get started" exit fi refresh_command='' tilde_bin_dir=$(tildify "$bin_dir") quoted_install_dir=\"${install_dir//\"/\\\"}\" if [[ $quoted_install_dir = \"$HOME/* ]]; then quoted_install_dir=${quoted_install_dir/$HOME\//\$HOME/} fi echo case $(basename "$SHELL") in fish) # Install completions, but we don't care if it fails IS_BUN_AUTO_UPDATE=true SHELL=fish $exe completions &>/dev/null || : commands=( "set --export $install_env $quoted_install_dir" "set --export PATH $bin_env \$PATH" ) fish_config=$HOME/.config/fish/config.fish tilde_fish_config=$(tildify "$fish_config") if [[ -w $fish_config ]]; then { echo -e '\n# bun' for command in "${commands[@]}"; do echo "$command" done } >>"$fish_config" info "Added \"$tilde_bin_dir\" to \$PATH in \"$tilde_fish_config\"" refresh_command="source $tilde_fish_config" else echo "Manually add the directory to $tilde_fish_config (or similar):" for command in "${commands[@]}"; do info_bold " $command" done fi ;; zsh) # Install completions, but we don't care if it fails IS_BUN_AUTO_UPDATE=true SHELL=zsh $exe completions &>/dev/null || : commands=( "export $install_env=$quoted_install_dir" "export PATH=\"$bin_env:\$PATH\"" ) zsh_config=$HOME/.zshrc tilde_zsh_config=$(tildify "$zsh_config") if [[ -w $zsh_config ]]; then { echo -e '\n# bun' for command in "${commands[@]}"; do echo "$command" done } >>"$zsh_config" info "Added \"$tilde_bin_dir\" to \$PATH in \"$tilde_zsh_config\"" refresh_command="exec $SHELL" else echo "Manually add the directory to $tilde_zsh_config (or similar):" for command in "${commands[@]}"; do info_bold " $command" done fi ;; bash) commands=( "export $install_env=$quoted_install_dir" "export PATH=$bin_env:\$PATH" ) bash_configs=( "$HOME/.bashrc" "$HOME/.bash_profile" ) if [[ ${XDG_CONFIG_HOME:-} ]]; then bash_configs+=( "$XDG_CONFIG_HOME/.bash_profile" "$XDG_CONFIG_HOME/.bashrc" "$XDG_CONFIG_HOME/bash_profile" "$XDG_CONFIG_HOME/bashrc" ) fi set_manually=true for bash_config in "${bash_configs[@]}"; do tilde_bash_config=$(tildify "$bash_config") if [[ -w $bash_config ]]; then { echo -e '\n# bun' for command in "${commands[@]}"; do echo "$command" done } >>"$bash_config" info "Added \"$tilde_bin_dir\" to \$PATH in \"$tilde_bash_config\"" refresh_command="source $bash_config" set_manually=false break fi done if [[ $set_manually = true ]]; then echo "Manually add the directory to $tilde_bash_config (or similar):" for command in "${commands[@]}"; do info_bold " $command" done fi ;; *) echo 'Manually add the directory to ~/.bashrc (or similar):' info_bold " export $install_env=$quoted_install_dir" info_bold " export PATH=\"$bin_env:\$PATH\"" ;; esac echo info "To get started, run:" echo if [[ $refresh_command ]]; then info_bold " $refresh_command" fi info_bold " bun --help" ion> Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/examples/framework-multiple/src/components (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2024-04-02[ci] update lockfile (#10551)Gravatar Houston (Bot) 15-1051/+1165
Co-authored-by: matthewp <matthewp@users.noreply.github.com> Co-authored-by: bluwy <bjornlu.dev@gmail.com>
2024-04-01[ci] formatGravatar Arsh 4-17/+19
2024-04-02community onboarding: codebase documentation around runtime (#10612)Gravatar Arsh 8-39/+150
* document runtime * apply suggestions from code review
2024-04-01[ci] formatGravatar Ben Holmes 3-3/+3
2024-04-01db: Better error messages when querying remote (#10636)Gravatar Ben Holmes 6-32/+69
* feat: clear error messages on remote db error * refactor: use AstroDbError for correct error name * refactor: errorMessage -> responseMessage * chore: changeset * fix: revert seed file change * fix: format seed errors as AstroDbError * fix: correctly log eager seed errors
2024-04-01Give proper error when seed missing default export (#10635)Gravatar Matthew Phillips 2-1/+6
2024-04-01[ci] formatGravatar Matthew Phillips 2-4/+4
2024-04-01Make ASTRO_DATABASE_FILE work with file paths (#10631)Gravatar Matthew Phillips 4-4/+43
* Make ASTRO_DATABASE_FILE work with file paths * Use pathToFileURL
2024-04-01Make `@astrojs/markdown-remark` a dep in `@astrojs/markdoc` (#10632)Gravatar Bjorn Lu 3-4/+9
2024-04-01[ci] formatGravatar Ben Holmes 1-2/+2
2024-04-01db: Seed on dev server startup (#10599)Gravatar Ben Holmes 3-11/+54
* feat: load seed file on dev server startup * feat: handle logging on dev server restart * chore: changeset * feat: support integration seed files * fix: only run when seed is present, ignore unlink * fix: load on startup for integration pkg paths
2024-04-01Remove deprecated APIs from `@astrojs/markdown-remark` (#10629)Gravatar Bjorn Lu 7-81/+23
Co-authored-by: Florian Lefebvre <contact@florian-lefebvre.dev>
2024-04-01Lazy loaded shiki languages during syntax highlighting (#10618)Gravatar James Garbutt 16-110/+169
2024-04-01Move nft warnings behind verbose logging (#10609)Gravatar Matthew Phillips 2-2/+7
* Move nft warnings behind verbose logging * Update packages/integrations/vercel/src/lib/nft.ts Co-authored-by: Arsh <69170106+lilnasy@users.noreply.github.com> * Update packages/integrations/vercel/src/lib/nft.ts Co-authored-by: Arsh <69170106+lilnasy@users.noreply.github.com> --------- Co-authored-by: Arsh <69170106+lilnasy@users.noreply.github.com>
2024-04-01Fixes issue with head content being pushed into body (#10608)Gravatar Matthew Phillips 3-7/+12
* Fixes issue with head content being pushed into body * Update snapshot version * Upgrade compiler version
2024-04-01feat: rework child rendering to use class (#10624)Gravatar James Garbutt 2-33/+51
2024-04-01refactor: Drop Preact compat hack, remove incorrect alias (#10585)Gravatar Ryan Christian 2-8/+7
Co-authored-by: Arsh <69170106+lilnasy@users.noreply.github.com>
2024-04-01[ci] formatGravatar ktym4a 1-1/+1
2024-04-01fix(starlog): Correct layout syntax. (#10627)Gravatar ktym4a 2-7/+7
2024-04-01fix: use ReadableStream for response object if deno (#10495)Gravatar Satya Rohith 3-2/+13
2024-03-29Remove the ssr external for vue (#10601)Gravatar Tyler van der Hoeven 2-1/+5
* remove the ssr external for vue * Remove the external line vs comment it out * add a changeset
2024-03-29reset history title after push/replace but prior to assignment to location ↵Gravatar Martin Trapp 2-1/+6
(#10605) * reset history title after push/replace but prior to assignment to location * add changeset
2024-03-29fix: dont error on nullish prop values in jsx runtime (#10584)Gravatar duanwilliam 2-1/+6
* fix: prevent jsx runtime from erroring on nullish prop values when checking for slot props * chore: changeset
2024-03-28[ci] release (#10598)astro@4.5.12@astrojs/vercel@7.5.0@astrojs/markdoc@0.9.3@astrojs/internal-helpers@0.4.0@astrojs/db@0.9.8Gravatar Houston (Bot) 6-50/+52
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-28[ci] formatGravatar TK 1-2/+2
2024-03-28feat: allow dynamic route segments in isr.exclude array (#10513)Gravatar TK 5-3/+69
* Allow dynamic route segments in isr.exclude array * copy over eslint-disable as well * add test * update test: slashes dont need to be escaped * update changeset --------- Co-authored-by: lilnasy <69170106+lilnasy@users.noreply.github.com>
2024-03-28[ci] formatGravatar Houston (Bot) 2-3/+3
2024-03-28[ci] release (#10597)Gravatar Houston (Bot) 37-66/+89
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-03-28db: Rework index config with generated index names (#10589)Gravatar Ben Holmes 6-68/+344
* feat: add indexes array config with name gen * fix: add _idx suffix, remove name from output * feat(test): new index config * chore: remove unused type * chore: changeset * chore: add sort() for consistent names * feat(test): consistent column ordering * feat(test): ensure no queries when migrating legacy to new