bevry / dorothy

🧙🏻‍♀️ Bring your dotfile commands and configuration to any shell. Sensible defaults and hundreds of commands preloaded. Supports Bash, Zsh, Fish, Nu, Xonsh, Elvish, Dash, KornShell, macOS, Linux, Windows.
Other
332 stars 22 forks source link

Ongoing: upgrade & integration support #185

Open balupton opened 1 year ago

balupton commented 1 year ago

This topic will be used to ping dorothy users when there may be breaking changes that affect them when upgrading, or new features that are nifty.

Subscribe to this issue if you are a Dorothy user.

balupton commented 1 year ago

@jondpenton @molleweide echo-quiet has been renamed to is-quiet-enabled and echo-color has been renamed to is-color-enabled: https://github.com/bevry/dorothy/commit/c539412ce55dbde825a028604e65580e9a8d561f

@jondpenton looking at your modifications:

Other notable changes in recent weeks:

If you have time, I could do with feedback on this proposal: https://github.com/bevry/dorothy/issues/173

Feel free to ping me back here for any additional support or discussions around integration with dorothy.

jondpenton commented 1 year ago

@balupton

  • Your modifications relating to skipping prompts for defaults, is one I'm happy to figure out how to incorporate into core. To get it into core, there is probably two steps (1) having configuration options to specify defaults for all prompts, and (2) having shorter or no timeout for when defaults are provided: #77

Having the prompts in setup-system install feels right to me, but not really for setup-system update. I prefer to have a single update command that runs through updating everything. I think a good compromise would be to support specifying prompt responses/defaults in one of the configuration files that setup-system update pulls from.

  • what were the issues you were having with is-wsl? I'm keen to fix all bugs.

I had to override is-wsl in a number of commands because it was downloading a .exe of the util, even though I was on a Linux distro in WSL.

Sure! I hope to eventually move all of my Nushell configurations/commands over. I think it'd be great to have an example repo like mine for someone coming from Nushell.

balupton commented 1 year ago

@jondpenton

Having the prompts in setup-system install feels right to me, but not really for setup-system update. I prefer to have a single update command that runs through updating everything. I think a good compromise would be to support specifying prompt responses/defaults in one of the configuration files that setup-system update pulls from.

Good feedback, completely agree. Created an issue: https://github.com/bevry/dorothy/issues/186

I had to override is-wsl in a number of commands because it was downloading a .exe of the util, even though I was on a Linux distro in WSL.

Interesting, I had figured WSL would prefer .exe's but I guess not. I'll boot up my Windows machine and see what the go is.

Sure! I hope to eventually move all of my Nushell configurations/commands over. I think it'd be great to have an example repo like mine for someone coming from Nushell.

Done!

balupton commented 1 year ago

@jondpenton

I had to override is-wsl in a number of commands because it was downloading a .exe of the util, even though I was on a Linux distro in WSL.

I just pushed up https://github.com/bevry/dorothy/commit/d56c6e3ec32398e106fc2c7f2ffacf4394ec3515 which prefers the linux binaries over the windows binaries. I've tested this on Windows 10 WSL2 Ubuntu and it worked fine. Let me know if you have issues.

balupton commented 1 year ago

Just pushed up https://github.com/bevry/dorothy/commit/e3e9ef47d9119172bb20ff03f396503d172a658e to master which properly supports winget on wsl, and correctly sets up the wsl path, allowing you to call .exes from windows.

balupton commented 1 year ago

A breaking change for scripts just landed that affects scripts that are loading or saving configuration: https://github.com/bevry/dorothy/commit/de23d08e4cb7cc7823b8638a479d86831d8f2bf8

config.bash is removed, it would source config.sh and define the following:

# old code
source "$DOROTHY/sources/config.bash"
local HOMEBREW_FORMULAS=()
load_dorothy_config 'setup.bash'
mapfile -t HOMEBREW_FORMULAS < <(prepare_packages 'HOMEBREW_FORMULAS' -- "${HOMEBREW_FORMULAS[@]}")
update_dorothy_user_config 'setup.bash' -- --field='HOMEBREW_ENCODING_INSTALL' --value="$HOMEBREW_ENCODING_INSTALL"

config.sh still exists to provide load_dorothy_config, however the prepare_packages and update_dorothy_user_config from config.bash are now replaced by the new dorothy-config command:

# new code
source "$DOROTHY/sources/config.sh"
local HOMEBREW_FORMULAS=()
load_dorothy_config 'setup.bash'
mapfile -t HOMEBREW_FORMULAS < <(dorothy-config --packages-var='HOMEBREW_FORMULAS' -- "${HOMEBREW_FORMULAS[@]}")
dorothy-config 'setup.bash' -- --field='HOMEBREW_ENCODING_INSTALL' --value="$HOMEBREW_ENCODING_INSTALL"
balupton commented 9 months ago

There is a significant update coming today, which gets all commands/* using modern conventions but may have some easy to resolve breaking changes, which apply only if you have been forking dorothy commands or writing your own commands.

If you have problems and are a Dorothy user with a public dotfiles repo, I'll clone out your configurations and do any necessary upgrades as a PR. If you have a private user configuration repo, you can become a GitHub Sponsor and add me as an outside collaborator and I'll do any necessary upgrades.

balupton commented 9 months ago

The big update is now merged, please read the changelog and see if anything applies to you: https://github.com/bevry/dorothy/commit/3ace11f0a103e5a305fc9a9fb10271007579091e

The biggest breaking change:

# from
echo-escape-regex
# to
echo-escape-regexp

The biggest non-breaking changes:

# from
option_NAME="$(get-flag-value NAME --missing="$option_NAME" -- "$item" | echo-affirmative --stdin)"
# to
option_NAME="$(get-flag-value --affirmative --fallback="$option_NAME" -- "$item")"

# from
is-needle --quiet "$@" && ! is-needle --upgrade "$@" && ! is-needle --uninstall "$@" && command-exists CLI
# to
setup-util "$@" --check --cli=CLI

# from
DOWNLOAD_UNZIP_FILTER
# to
DOWNLOAD_ARCHIVE_GLOB
balupton commented 3 months ago

The merging of #229 will happen within the next 12-24 hours (6 months of work, 5000 changed lines). Please test it (the dev-defaults branch) on a test machine if you are able.

Video from a few months ago (somewhat outdated) for the new choose command:

https://github.com/bevry/dorothy/assets/61148/a0af26a2-1493-4000-8f26-16e542384fba

balupton commented 3 months ago

229 now merged, which closes:

Enjoy everyone!

balupton commented 3 months ago

My next Dorothy work are the tasks inside this milestone: https://github.com/bevry/dorothy/milestone/3

Of which the priorities will be:

  1. 221

  2. 233

  3. 195

Then I will focus on some digital errands, like tax, packs, and servers to get my monthly revenue up.

Then will return to Dorothy in December to pump out dozens of short little introductory videos.

balupton commented 1 month ago

https://github.com/bevry/dorothy/pull/250 is now merged, it is a large change, 4000 changed lines, only two items that require dev changes:

refer to the PR for the full list

balupton commented 2 weeks ago

254 is now merged, it is a huge change, 251 changed files, +6,329 additions, −3,379 removals. It closes:

Things to be aware of when upgrading:

As always, refer to the PR for the full list of updates.