<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mason/tests/mason-core/package/package_spec.lua, branch stable</title>
<subtitle>[no description]</subtitle>
<id>http://git.sudomsg.com/mirror/mason/atom/tests/mason-core/package/package_spec.lua?h=stable</id>
<link rel='self' href='http://git.sudomsg.com/mirror/mason/atom/tests/mason-core/package/package_spec.lua?h=stable'/>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/mason/'/>
<updated>2026-04-06T18:08:26Z</updated>
<entry>
<title>fix: actually emit the receipt in uninstall event payloads (#2071)</title>
<updated>2026-04-06T18:08:26Z</updated>
<author>
<name>William Boman</name>
<email>william@redwill.se</email>
</author>
<published>2026-04-06T18:08:26Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/mason/commit/?id=b03fb0f20bc1d43daf558cda981a2be22e73ac42'/>
<id>urn:sha1:b03fb0f20bc1d43daf558cda981a2be22e73ac42</id>
<content type='text'>
</content>
</entry>
<entry>
<title>refactor(registry): change lua registries to not instantiate Package themselves</title>
<updated>2025-05-02T01:57:07Z</updated>
<author>
<name>William Boman</name>
<email>william@redwill.se</email>
</author>
<published>2025-05-02T01:52:10Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/mason/commit/?id=4da89f3ab04783da990f9bd40aaa36c22e59375b'/>
<id>urn:sha1:4da89f3ab04783da990f9bd40aaa36c22e59375b</id>
<content type='text'>
Instead of having Lua registries instantiate package instances
themselves we now do it in the installer of Lua registry sources.

This aligns the behaviour of the Lua registry protocol with the other
registry protocols.
</content>
</entry>
<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: standardize constructors and improve inheritance construction</title>
<updated>2025-02-19T08:23:19Z</updated>
<author>
<name>William Boman</name>
<email>william@redwill.se</email>
</author>
<published>2023-10-13T19:14:29Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/mason/commit/?id=ae208dc380808ff1aef39929a0e897e881571d43'/>
<id>urn:sha1:ae208dc380808ff1aef39929a0e897e881571d43</id>
<content type='text'>
</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>refactor!: consolidate Lua registry sources and the Package API (#1498)</title>
<updated>2025-02-16T08:48:59Z</updated>
<author>
<name>William Boman</name>
<email>william@redwill.se</email>
</author>
<published>2023-09-10T22:37:05Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/mason/commit/?id=d0119c18adff184c5c75f7ec59b6f12b301d268d'/>
<id>urn:sha1:d0119c18adff184c5c75f7ec59b6f12b301d268d</id>
<content type='text'>
**This removes the following APIs:**
- `Package:check_new_version()`. Instead use the new `Package:get_latest_version()`.

**This has a breaking change in the following APIs:**
- `Package:get_installed_version()` now no longer takes a callback but instead returns the installed version or `nil` if
  not installed.

&lt;details&gt;
&lt;summary&gt;To handle these breaking changes in plugins, leverage the `mason.version` module, for example:&lt;/summary&gt;

```lua
local mason_version = require("mason.version")
local registry = require("mason-registry")
local pkg = registry.get_package("rust-analyzer")

if mason_version.MAJOR_VERSION &lt; 2 then
    -- before
    pkg:check_new_version(function (success, new_version)
        -- …
    end)
    pkg:get_installed_version(function (success, installed_version)
        -- …
    end)
else
    -- after
    local new_version = pkg:get_latest_version()
    local installed_version = pkg:get_installed_version()
fi
```

&lt;/details&gt;

---

&lt;details&gt;
&lt;summary&gt;This change also introduces breaking changes for Lua registry sources, by consolidating the package schema with the
registry.&lt;/summary&gt;

The following is an example of a package defined in a Lua registry, following the new schema:

```lua
local Pkg = require("mason-core.package")

return Pkg.new {
    schema = "registry+v1",
    name = "ripgrep",
    description = "ripgrep recursively searches directories for a regex pattern while respecting your gitignore.",
    homepage = "https://github.com/BurntSushi/ripgrep",
    licenses = { Pkg.License.MIT },
    languages = {},
    categories = {},
    source = {
        id = "pkg:mason/ripgrep@13.0.0",
        ---@param ctx InstallContext
        ---@param purl Purl
        install = function(ctx, purl)
            -- Arbitrary installation code.
        end,
    },
    bin = {
        rg = "./bin/rg",
    },
}
```

&lt;/details&gt;
</content>
</entry>
<entry>
<title>fix: avoid calling vim.fn in fast event (#1878)</title>
<updated>2025-02-15T20:00:35Z</updated>
<author>
<name>William Boman</name>
<email>william@redwill.se</email>
</author>
<published>2025-02-15T20:00:35Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/mason/commit/?id=3a444cb7b0cee6b1e2ed31b7e76f37509075dc46'/>
<id>urn:sha1:3a444cb7b0cee6b1e2ed31b7e76f37509075dc46</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix: replace deprecated calls to vim.validate (#1876)</title>
<updated>2025-02-15T15:44:40Z</updated>
<author>
<name>Mark Sommers</name>
<email>42284859+marks0mmers@users.noreply.github.com</email>
</author>
<published>2025-02-15T15:44:40Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/mason/commit/?id=5664dd5deb3ac9527da90691543eb28df51c1ef8'/>
<id>urn:sha1:5664dd5deb3ac9527da90691543eb28df51c1ef8</id>
<content type='text'>
Co-authored-by: William Boman &lt;william@redwill.se&gt;</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: add github registry source capabilities (#1091)</title>
<updated>2023-03-12T07:21:15Z</updated>
<author>
<name>William Boman</name>
<email>william@redwill.se</email>
</author>
<published>2023-03-12T07:21:15Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/mason/commit/?id=a01d02ad7f680aec98a1e2ec35b04cedd307cfa8'/>
<id>urn:sha1:a01d02ad7f680aec98a1e2ec35b04cedd307cfa8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>fix(package): don't call vim API functions inside fast event (#730)</title>
<updated>2022-12-05T16:48:34Z</updated>
<author>
<name>William Boman</name>
<email>william@redwill.se</email>
</author>
<published>2022-12-05T16:48:34Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/mason/commit/?id=2381f507189e3e10a43c3932a3ec6c2847180abc'/>
<id>urn:sha1:2381f507189e3e10a43c3932a3ec6c2847180abc</id>
<content type='text'>
</content>
</entry>
<entry>
<title>refactor: introduce selene, harden type defs, and use proper EmmyLua syntax (#296)</title>
<updated>2022-08-15T19:03:06Z</updated>
<author>
<name>William Boman</name>
<email>william@redwill.se</email>
</author>
<published>2022-08-15T19:03:06Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/mason/commit/?id=3c62386a396ae0c1cd7adbaacc379eb4af072a65'/>
<id>urn:sha1:3c62386a396ae0c1cd7adbaacc379eb4af072a65</id>
<content type='text'>
</content>
</entry>
<entry>
<title>tests: add some mason-core.package tests (#69)</title>
<updated>2022-07-13T15:19:08Z</updated>
<author>
<name>William Boman</name>
<email>william@redwill.se</email>
</author>
<published>2022-07-13T15:19:08Z</published>
<link rel='alternate' type='text/html' href='http://git.sudomsg.com/mirror/mason/commit/?id=0c6dd949d395d1543c8813f028ae25b48947e50d'/>
<id>urn:sha1:0c6dd949d395d1543c8813f028ae25b48947e50d</id>
<content type='text'>
</content>
</entry>
</feed>
