Commit Graph

1858 Commits

Author SHA1 Message Date
Trevor Brown
bd3e35e022 Merge pull request #92 from asdf-vm/DeedleFake-rename-module-and-use-cmd-dir
feat(golang-rewrite): rename module and move `main` pacakge to `cmd/asdf`
2024-12-18 10:22:06 -05:00
Trevor Brown
0048dbfa95 Merge pull request #91 from asdf-vm/tb/plugin-test-command
feat(golang-rewrite): implement `asdf plugin test` command
2024-12-18 10:22:06 -05:00
DeedleFake
27f44a2dc9 feat(golang-rewrite): rename module and move main pacakge to cmd/asdf
* Replace direct `fmt.Println()` usage in a test with `t.Log()`
* Rename `cmd` to `cli`
* Move asdf command from module root
* Fix some linter warnings, thus enabling some tests that were being skipped
* Fix `Makefile`
* Rename module to `github.com/asdf-vm/asdf`
* Fix `TestGetAllToolsAndVersionsInContent/returns_empty_list_with_found_true_and_no_error_when_empty_content`
* Rewrite `Unique()` to be a bit more straightforwards
* Get workflow checks passing again

toolversions.Unique is ever so slightly faster, technically.

```
goos: linux
goarch: amd64
pkg: github.com/asdf-vm/asdf/internal/toolversions
cpu: AMD Ryzen 9 3900X 12-Core Processor
          │ /tmp/old.txt │            /tmp/new.txt            │
          │    sec/op    │   sec/op     vs base               │
Unique-24    346.5n ± 1%   342.4n ± 1%  -1.17% (p=0.027 n=10)

          │ /tmp/old.txt │          /tmp/new.txt          │
          │     B/op     │    B/op     vs base            │
Unique-24     160.0 ± 0%   160.0 ± 0%  ~ (p=1.000 n=10) ¹
¹ all samples are equal

          │ /tmp/old.txt │          /tmp/new.txt          │
          │  allocs/op   │ allocs/op   vs base            │
Unique-24     3.000 ± 0%   3.000 ± 0%  ~ (p=1.000 n=10) ¹
¹ all samples are equal
```
2024-12-18 10:22:06 -05:00
Trevor Brown
34e1e85bbb Merge pull request #90 from asdf-vm/tb/plugin-extension-commands
feat(golang-rewrite): implement asdf plugin extension commands
2024-12-18 10:22:06 -05:00
Your Name
a7ae6303cc feat(golang-rewrite): implement asdf plugin test command
* Enable `plugin_test_command.bats` tests
* Implement `asdf plugin test` command
2024-12-18 10:22:06 -05:00
Trevor Brown
5728e3709c Merge pull request #89 from asdf-vm/tb/plugin-list-all-tests
feat(golang-rewrite): implement `asdf plugin list all` command
2024-12-18 10:22:06 -05:00
Your Name
6501674809 feat(golang-rewrite): implement asdf plugin extension commands
* Enable `plugin_extension_command.bats` tests
* Add comment on `version_commands.bats` tests
* Show help output when asdf run with no arguments
* Document breaking change in asdf extension commands feature
* Create `Plugin.ExtensionCommandPath` method
* Create `asdf cmd` subcommand
* Get `plugin_extension_command.bats` tests passing
* Document breaking changes to asdf extension commands
2024-12-18 10:22:06 -05:00
Trevor Brown
8d5df1c0a4 Merge pull request #88 from asdf-vm/tb/install-command-tests
feat(golang-rewrite): get all `install_command.bats` tests passing
2024-12-18 10:22:06 -05:00
Trevor Brown
ec22c68b96 feat(golang-rewrite): implement asdf plugin list all command
* Enable `plugin_list_all_command.bats` tests
* Create `PluginIndex.Get` method
* Create `asdf plugin list all` subcommand
* Extract plugin index repo URL into config package
* Fix failing tests
2024-12-18 10:22:06 -05:00
Trevor Brown
0c390c46a8 feat(golang-rewrite): get all install_command.bats tests passing
* Enable `install_command.bats` tests
* Update `versions.InstallVersion` function to accept `toolversions.Version` struct
* Remove download directory after install if not configured to keep it
* Add download callback requirement to list of breaking changes
* Add `--keep-download` flag to install command
* Get all `install_command.bats` tests passing
2024-12-18 10:22:05 -05:00
Trevor Brown
b831807ec9 Merge pull request #87 from asdf-vm/tb/more-shim-exec-fixes-2
feat(golang-rewrite): get remaining `shim_exec.bats` tests passing
2024-12-18 10:21:42 -05:00
Trevor Brown
3aa5a0da49 Merge pull request #86 from asdf-vm/tb/more-shim-exec-fixes
feat(golang-rewrite): more shim exec fixes
2024-12-18 10:21:42 -05:00
Trevor Brown
8736de47e7 feat(golang-rewrite): get remaining shim_exec.bats tests passing
* Disable custom shim template tests
* Document another breaking change
* Enable `shim_exec.bats` tests
* Fix bug in `shims.getCustomExecutablePath` function
* Pass default relative executable path as third argument to `exec-path` callback
* Get remaining `shim_exec.bats` tests passing
2024-12-18 10:21:42 -05:00
Trevor Brown
9192e51708 Merge pull request #83 from asdf-vm/tb/shim-exec-fixes
fix(golang-rewrite): `asdf exec` and `asdf env` command fixes
2024-12-18 10:21:42 -05:00
Trevor Brown
1ea658d629 feat(golang-rewrite): more shim exec fixes
* Create `toolversions.ParseSlice` function
* Create `toolversions.Format` function
* Refactor `shims` package to use `toolversions.Version` struct
* Fix handling of path versions in `shims.FindExecutable` function
2024-12-18 10:21:42 -05:00
Trevor Brown
ce0f371d24 Merge pull request #82 from asdf-vm/tb/shim-exec-env
feat(golang-rewrite): implement `asdf env` command
2024-12-18 10:21:42 -05:00
Trevor Brown
ee8f88daaa fix(golang-rewrite): asdf exec and asdf env command fixes
* Create `CurrentEnv` and `MergeEnv` helper functions
* Add another test for `paths.RemoveFromPath` function
* Move executable finding functions to shims package
* Correct PATH code for env and exec commands
2024-12-18 10:21:42 -05:00
Trevor Brown
ddb0dd4bca Merge pull request #81 from asdf-vm/tb/reshim-fix
fix(golang-rewrite): allow directories returned by list-bin-paths to be absent from the file system
2024-12-18 10:21:42 -05:00
Trevor Brown
4d87349964 feat(golang-rewrite): implement asdf env command
* Create `CallbackPath` method on `Plugin` struct
* Correct behavior of `asdf shimversions` command
* Update `shims.FindExecutable` function to return plugin
* Create `repotest.WritePluginCallback` function
* Create `execenv` package for invoking `exec-env` plugin callback
* Make `MapToSlice` a public function
* Return resolved version from `shims.FindExecutable` function
* Create `shims.ExecutablePaths` function
* Enable `shim_env_command.bats` tests
* Implement `asdf env` command
2024-12-18 10:21:42 -05:00
Trevor Brown
517102b8ff Merge pull request #80 from asdf-vm/tb/asdf-version-info-fix-2
feat(golang-rewrite): correct asdf-version workflow step to produce version as output (second attempt)
2024-12-18 10:21:42 -05:00
Trevor Brown
64f70de694 fix(golang-rewrite): allow directories returned by list-bin-paths to be absent from the file system
* create `repotest.WritePluginCallback` function
* add test for `list-bin-paths` callback that returns non-existent path
* if directory name returned by `list-bin-paths` doesn't exist skip it
2024-12-18 10:21:42 -05:00
Trevor Brown
96124c416f Merge pull request #79 from asdf-vm/tb/asdf-version-info-fix
feat(golang-rewrite): correct asdf-version workflow step to produce version as output
2024-12-18 10:21:42 -05:00
Trevor Brown
5149f03925 feat(golang-rewrite): correct asdf-version workflow step to produce version as output 2024-12-18 10:21:42 -05:00
Trevor Brown
c18b2de10f Merge pull request #78 from asdf-vm/tb/asdf-version-info
feat(golang-rewrite): compile asdf version into Go binaries
2024-12-18 10:21:42 -05:00
Trevor Brown
d80b409b65 feat(golang-rewrite): correct asdf-version workflow step to produce version as output 2024-12-18 10:21:42 -05:00
Trevor Brown
9a7c12fb63 Merge pull request #77 from asdf-vm/tb/shim-exec-bats
feat(golang-rewrite): introduce `Version` struct, get some `shim_exec.bats` tests passing
2024-12-18 10:21:42 -05:00
Trevor Brown
c80b0ff380 feat(golang-rewrite): compile asdf version into Go binaries
* Create asdf-version script to print formatted version
* Update Makefile to set main.version variable during build
* Improve help output formatting
* Update release-build workflow to set asdf version in binaries
2024-12-18 10:21:42 -05:00
Trevor Brown
7d46d4bf50 Merge pull request #76 from asdf-vm/tb/shim-versions-command
feat(golang-rewrite): create shimversions command
2024-12-18 10:21:42 -05:00
Trevor Brown
424eed413b feat(golang-rewrite): introduce Version struct, get some shim_exec.bats tests passing
* Get more shim_exec.bats tests passing by adding shebang lines to test scripts
* Disable shim_exec test case for scenario that is no longer possible
* Add documentation on another breaking change
* Create toolversions.Version struct and update code to use new struct
2024-12-18 10:21:42 -05:00
Trevor Brown
3d4d4366ab Merge pull request #75 from asdf-vm/tb/upgrade-doc
feat(golang-rewrite): create version 0.14 to 0.15 upgrade guide
2024-12-18 10:21:42 -05:00
Trevor Brown
a5ecc6a557 feat(golang-rewrite): create shimversions command
* Enable `shim_versions_command.bats` tests
* Create `asdf shimversions` command
2024-12-18 10:21:42 -05:00
Trevor Brown
774723a52f Merge pull request #74 from asdf-vm/tb/remove-command-bats
feat(golang-rewrite): more `asdf plugin remove` tests
2024-12-18 10:21:42 -05:00
Trevor Brown
7025de2a24 feat(golang-rewrite): create version 0.14 to 0.15 upgrade guide 2024-12-18 10:21:42 -05:00
Trevor Brown
0d18fa1694 Merge pull request #73 from asdf-vm/tb/asdf-list-commands
feat(golang-rewrite): create `asdf list` and `asdf list all` commands
2024-12-18 10:21:42 -05:00
Trevor Brown
e75659ca67 feat(golang-rewrite): more asdf plugin remove tests
* Enable `remove_command.bats` tests
* Update `remove_command.bats` to use new command name
* Create `internal/data` package
* Use data package for install paths
* Get all asdf plugin remove command BATS tests passing
2024-12-18 10:21:42 -05:00
Trevor Brown
00c9178b77 Merge pull request #72 from asdf-vm/tb/asdf-uninstall-command
feat(golang-rewrite): create `asdf uninstall` command
2024-12-18 10:21:42 -05:00
Trevor Brown
3be463524e feat(golang-rewrite): create asdf list and asdf list all commands
* Enable `asdf list` BATS tests
* Update list_command.bats code to use non-hyphenated version of list all command
* Implement `asdf list all` command
* Implement `asdf list` command
2024-12-18 10:21:42 -05:00
Trevor Brown
241949bc19 Merge pull request #71 from asdf-vm/tb/asdf-where-command
feat(golang-rewrite): create `asdf where` command
2024-12-18 10:21:42 -05:00
Trevor Brown
deef401fd3 feat(golang-rewrite): create asdf uninstall command
* Enable asdf uninstall BATS tests
* Create `toolversions.ParseFromCliArg` function
* Create `versions.Uninstall` function
* Update `ParseFromCliArg` function to handle latest version without optional filter value
* Create `asdf uninstall` command
* Comment out invalid test
* Address linter warnings
2024-12-18 10:21:42 -05:00
Trevor Brown
ed0bb953b7 Merge pull request #70 from asdf-vm/tb/asdf-help-command
feat(golang-rewrite): implement `asdf help` command
2024-12-18 10:21:42 -05:00
Trevor Brown
0a58b32142 feat(golang-rewrite): create asdf where command
* Move `versions.ParseString` function to the toolversions package
* Create `toolversions.FormatForFS` function
* use new `toolversions.FormatForFS` function
* Create `asdf where` command
* Enable BATS tests for `asdf where` command
2024-12-18 10:21:42 -05:00
Trevor Brown
00e56bf47d Merge pull request #68 from asdf-vm/tb/which-command
feat(golang-rewrite): create `asdf which` command
2024-12-18 10:21:42 -05:00
Trevor Brown
a33bbd8531 feat(golang-rewrite): implement asdf help command
* Create help package
* Add help command
* Enable help command BATS tests
* Implement functions in help package
* Write tests
* Correct function call in `installPlugin` test helper in shims package
2024-12-18 10:21:42 -05:00
Trevor Brown
f69d16c2fd feat(golang-rewrite): create asdf which command
* create asdf which command
* enable which_command.bats tests
* add more info to NoExecutableForPluginError
* Write tests for shims.GetExecutablePath function
* Use plugin `exec-path` callback when present to compute executable
path
2024-12-18 10:21:42 -05:00
Trevor Brown
1ab256335f Merge pull request #69 from asdf-vm/tb/build-release-binaries
feat(golang-rewrite): build dev release binaries
2024-12-18 10:21:41 -05:00
Trevor Brown
87809c176f Merge pull request #67 from asdf-vm/tb/current-command
feat(golang-rewrite): create `asdf current` command
2024-12-18 10:21:41 -05:00
Trevor Brown
c1c0d52891 feat(golang-rewrite): build dev release binaries
* Use `wangyoucao577/go-release-action@v1` to build Go binaries for releases
* set release tag for `go-release-action`
2024-12-18 10:21:41 -05:00
Trevor Brown
2d3564534a Merge pull request #66 from asdf-vm/tb/shim-exec-2
feat(golang-rewrite): create `asdf exec` command
2024-12-18 10:21:41 -05:00
Trevor Brown
c86e84fffb feat(golang-rewrite): create asdf current command
* Create asdf current command
* Correct output of asdf exec command when no command is provided
* Enable current_command.bats tests
* Fix current_command.bats test code
2024-12-18 10:21:41 -05:00
Trevor Brown
a889d8369d Merge pull request #65 from asdf-vm/tb/shim-exec-1
feat(golang-rewrite): create `shims.FindExecutable` function for shim execution
2024-12-18 10:21:41 -05:00