<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mason/tests/mason-core/result_spec.lua, branch stable</title>
<subtitle>[no description]</subtitle>
<id>http://git.sudomsg.com/mirror/mason/atom/tests/mason-core/result_spec.lua?h=stable</id>
<link rel='self' href='http://git.sudomsg.com/mirror/mason/atom/tests/mason-core/result_spec.lua?h=stable'/>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/mason/'/>
<updated>2025-02-19T11:15:48Z</updated>
<entry>
<title>refactor!: change Package API</title>
<updated>2025-02-19T11:15:48Z</updated>
<author>
<name>William Boman</name>
<email>william@redwill.se</email>
</author>
<published>2023-11-06T23:29:18Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/mason/commit/?id=6a7662760c515c74f2c37fc825776ead65d307f9'/>
<id>urn:sha1:6a7662760c515c74f2c37fc825776ead65d307f9</id>
<content type='text'>
This changes the following public APIs:

**(_breaking_) Events on the `Package` class**
The `uninstall:success` event on the `Package` class now receives an `InstallReceipt` as argument, instead of an
`InstallHandle`. This receipt is an in-memory representation of what was uninstalled. There's also a new
`uninstall:failed` event for situations where uninstallation for some
reason fails. Note: this also applies to the registry events (i.e.
`package:uninstall:success` and `package:uninstall:failed`).

---

**(_breaking_) `Package:uninstall()` is now asynchronous and receives two new arguments, similarly to `Package:install()`**
While package uninstallations remain synchronous under the hood, the public API has been changed from synchronous -&gt;
asynchronous. Users of this method are recommended to provide a callback in situations where code needs to execute after
uninstallation fully completes.

---

**(_breaking_) `Package:get_install_path()` has been removed.

---

**`Package:install()` now takes an optional callback**
This callback allows consumers to be informed whether installation was successful or not without having to go through a
different, low-level, API. See below for a comparison between the old and new APIs:
```lua
-- before
local handle = pkg:install()
handle:once("closed", function ()
    -- ...
end)

-- after
pkg:install({}, function (success, result)
    -- ...
end)
```
</content>
</entry>
<entry>
<title>refactor!: refactor installer internals and add new Package class methods (#1523)</title>
<updated>2025-02-19T08:22:40Z</updated>
<author>
<name>William Boman</name>
<email>william@redwill.se</email>
</author>
<published>2023-10-11T14:31:50Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/mason/commit/?id=047ec18da56ad8f331e5c6bc7417dc5a9a6e71cc'/>
<id>urn:sha1:047ec18da56ad8f331e5c6bc7417dc5a9a6e71cc</id>
<content type='text'>
This contains the following changes:
1) `Package:install()` now accepts a second, optional, callback argument which is called when installation finishes
   (successfully or not).
2) Adds a `Package:is_installing()` method.

This contains the following breaking changes:
1) `Package:install()` will now error when called while an installation is already ongoing. Use the new
   `Package:is_installing()` method to check whether an installation is already running.

This also refactors large portions of the tests by removing test globals, removing async_test, and adding the
`mason-test` Lua module instead. Test helpers via globals are problematic to work with due to not being detected through
tools like the Lua language server without additional configuration. This has been replaced with a Lua module
`mason-test`. `async_test` has also been removed in favour of explicitly making use of the `mason-core.async` API. These
changes stands for a significant portion of the diff.
</content>
</entry>
<entry>
<title>style: enforce import order (#1092)</title>
<updated>2023-03-12T08:26:02Z</updated>
<author>
<name>William Boman</name>
<email>william@redwill.se</email>
</author>
<published>2023-03-12T08:26:02Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/mason/commit/?id=698cd0c4f10480991e665f31977650858d625af1'/>
<id>urn:sha1:698cd0c4f10480991e665f31977650858d625af1</id>
<content type='text'>
* chore(workflows): update dependencies

* style: enforce import order</content>
</entry>
<entry>
<title>feat(installer): add share links (#965)</title>
<updated>2023-02-17T19:08:45Z</updated>
<author>
<name>William Boman</name>
<email>william@redwill.se</email>
</author>
<published>2023-02-17T19:08:45Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/mason/commit/?id=f3d90e3b7580a2d1b47a1f9b905808e22a7fac87'/>
<id>urn:sha1:f3d90e3b7580a2d1b47a1f9b905808e22a7fac87</id>
<content type='text'>
* feat(installer): add share links

Adds the ability to symlink share files to ~/.local/share/nvim/mason/share (default location). This is currently not
used by any packages but will be soon (e.g. linking .jar files to a canonical location on the fs).

This also includes the following changes:
- fix(windows): correctly unlink executables

  Prior to this change, executables on Windows would not be removed when uninstalling a package.

- refactor(installer): use Result interfaces

  The motivation behind this is to move away from exceptions and pcalls to leverage the Result interface.
  This allows for better error messaging during installation, as well as improved composability of actions that may
  or may not fail.

- refactor(bin): use absolute paths in exec wrapper scripts
  While relative paths are preferred and will end up returning in the future, they i) cannot be guaranteed for all
  packages, and ii) is somewhat complicated to produce due to lack of std APIs.

  Moving the entire Mason installation directory was never officially supported anyway.

- feat(installer): add "force" flag
  When this flag is true, any existing executables or share files will be overridden if they exist (i.e. mangle another
  package installation).

* refactor(result): always return Result objects in Result.try

The rationale here used to be that exceptions in Result.try() blocks were treated truly as exceptions that should
interrupt code execution per Lua's traditional error handling semantics. However, Lua code is somewhat prone to raise
exceptions when you don't expect it to (especially when interacting with loosely documented external APIs). Combine this
with the fact that code that invokes Result.try() blocks generally doesn't `pcall` and only relies on the Result API to
handle errors, you end up with code that only gracefully handles one class of errors (the well-known ones).

* test(terminator): sleep in tests to avoid race condition

I've no idea why this doesn't pass in CI, works just fine locally.</content>
</entry>
<entry>
<title>feat(result): add .try() interface (#804)</title>
<updated>2022-12-26T15:59:31Z</updated>
<author>
<name>William Boman</name>
<email>william@redwill.se</email>
</author>
<published>2022-12-26T15:59:31Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/mason/commit/?id=6f3d6e08e143f6f843410391991a2fc1db113ef2'/>
<id>urn:sha1:6f3d6e08e143f6f843410391991a2fc1db113ef2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>feat: add expr module (#775)</title>
<updated>2022-12-19T23:02:41Z</updated>
<author>
<name>William Boman</name>
<email>william@redwill.se</email>
</author>
<published>2022-12-19T23:02:41Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/mason/commit/?id=ca77c845f71b669a3378c976d1f7cf729aee2614'/>
<id>urn:sha1:ca77c845f71b669a3378c976d1f7cf729aee2614</id>
<content type='text'>
This is (soon) to be used when installing package definitions from
https://github.com/mason-org/mason-registry/. See for example:
https://github.com/mason-org/mason-registry/blob/7df69dd2a73efc3a08520552ca64597d1db5f4fb/packages/go-debug-adapter/package.yaml#L16</content>
</entry>
<entry>
<title>fix(fetch): set proper iwr header on Windows, reorder tool priority (#531)</title>
<updated>2022-10-09T21:41:42Z</updated>
<author>
<name>William Boman</name>
<email>william@redwill.se</email>
</author>
<published>2022-10-09T21:41:42Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/mason/commit/?id=3fa66adfc794238e0d0ae55c06403b3ea09d1cef'/>
<id>urn:sha1:3fa66adfc794238e0d0ae55c06403b3ea09d1cef</id>
<content type='text'>
Old priority: platform specific &gt; wget &gt; curl
New priority: curl &gt; wget &gt; platform specific</content>
</entry>
<entry>
<title>feat(npm): speed up checking for new versions (#530)</title>
<updated>2022-10-09T21:14:15Z</updated>
<author>
<name>William Boman</name>
<email>william@redwill.se</email>
</author>
<published>2022-10-09T21:14:15Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/mason/commit/?id=f336a8fac9090b4f8f5b3b430b5870efbd4b9113'/>
<id>urn:sha1:f336a8fac9090b4f8f5b3b430b5870efbd4b9113</id>
<content type='text'>
</content>
</entry>
<entry>
<title>feat(cargo): improve handling of git-based crates (#512)</title>
<updated>2022-10-05T18:33:21Z</updated>
<author>
<name>William Boman</name>
<email>william@redwill.se</email>
</author>
<published>2022-10-05T18:33:21Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/mason/commit/?id=738684097dfdd9a4a67cd217b0beda3e169bd85d'/>
<id>urn:sha1:738684097dfdd9a4a67cd217b0beda3e169bd85d</id>
<content type='text'>
This is all pretty overkill, especially considering the small amount of
packages based on git-based crates.</content>
</entry>
<entry>
<title>refactor: add mason-schemas and mason-core modules (#29)</title>
<updated>2022-07-08T16:34:38Z</updated>
<author>
<name>William Boman</name>
<email>william@redwill.se</email>
</author>
<published>2022-07-08T16:34:38Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/mason/commit/?id=976aa4fbee8a070f362cab6f6ec84e9251a90cf9'/>
<id>urn:sha1:976aa4fbee8a070f362cab6f6ec84e9251a90cf9</id>
<content type='text'>
* refactor: add mason-schemas and move generated filetype map to mason-lspconfig

* refactor: add mason-core module</content>
</entry>
</feed>
