|
1 | 1 | # Changelog
|
2 | 2 |
|
| 3 | +## [2.0.0](https://github.com/williamboman/mason.nvim/compare/v1.11.0...v2.0.0) (2025-05-06) |
| 4 | + |
| 5 | +This release has been an ongoing effort for quite some time now and is now ready for release. Most users should not |
| 6 | +experience any breaking changes. If you use any of the Lua APIs that Mason provides you'll find an outline of the |
| 7 | +changes below, breaking changes are marked with `Breaking Change`. |
| 8 | + |
| 9 | +### Repository has been moved |
| 10 | + |
| 11 | +The repository has been transferred to the [`mason-org`](https://github.com/mason-org) organization. The new URL is |
| 12 | +https://github.com/mason-org/mason.nvim. The previous URL will continue to function as a redirect to the new URL but |
| 13 | +users are recommended to update to the new location. |
| 14 | + |
| 15 | +### Addition of new maintainers ❤️ |
| 16 | + |
| 17 | +- [@mehalter](https://github.com/mehalter) |
| 18 | +- [@Conarius](https://github.com/Conarius) |
| 19 | +- [@chrisgrieser](https://github.com/chrisgrieser) |
| 20 | + |
| 21 | +### Features |
| 22 | +- Symlinks now uses relative paths instead of absolute paths. |
| 23 | +- Uninstalled packages now display their available version in the `:Mason` UI. |
| 24 | +- Packages in the `:Mason` UI now display the source [`purl`](https://github.com/package-url/purl-spec). |
| 25 | +- Official support for [custom registries](https://github.com/mason-org/registry-examples). |
| 26 | +- Make registry installations run concurrently. |
| 27 | +- Add support for `'winborder'`. |
| 28 | +- Display current `mason.nvim` version in the `:Mason` UI header. |
| 29 | + |
| 30 | +### Bug Fixes |
| 31 | +- Only attempt unlinking package if the receipt is found. |
| 32 | +- Expand executable paths on Windows before passing to uv_spawn. |
| 33 | +- Fix initializing UI state when using multiple registries. |
| 34 | +- Fix the display of outdated packages in the Mason UI under certain conditions. |
| 35 | + |
| 36 | +### Misc |
| 37 | +- `Breaking Change` Minimum Neovim requirement changed from 0.7.0 to 0.10.0. |
| 38 | +- `Breaking Change` APIs related to custom packages written in Lua has been removed. |
| 39 | + - All `require("mason-core.installer.managers")` modules have been removed. |
| 40 | + - The package structure of Lua packages has changed, refer to [custom |
| 41 | + registries](https://github.com/mason-org/registry-examples) for information on how to continue using custom |
| 42 | + packages in Lua. |
| 43 | + |
| 44 | +### Event changes |
| 45 | + |
| 46 | +#### Package |
| 47 | +- `Breaking Change` `install:success` now provides the receipt as payload argument. |
| 48 | +- `Breaking Change` `install:failed` now provides the error as payload argument. |
| 49 | +- `Breaking Change` `uninstall:success` now provides the receipt of the uninstalled package as payload argument. |
| 50 | +- `uninstall:failed` is now emitted when package uninstallation fails. |
| 51 | + |
| 52 | +#### Registry |
| 53 | +- `Breaking Change` `package:install:success` now provides the receipt as payload argument. |
| 54 | +- `Breaking Change` `package:install:failed` now provides the error as payload argument. |
| 55 | +- `Breaking Change` `package:uninstall:success` now provides the receipt of the uninstalled package as payload argument. |
| 56 | +- `package:uninstall:failed` is now emitted when package uninstallation fails. |
| 57 | +- `Breaking Change` `update` is no longer emitted when registry is updated. It's replaced by the following events: |
| 58 | + - `update:start` when the registry starts updating |
| 59 | + - `update:success` when the registry is successfully updated |
| 60 | + - `update:failed` when the registry failed to update |
| 61 | + - `update:progress` is emitted when the registry update process makes progress when multiple registries are used |
| 62 | + |
| 63 | +### Package API changes |
| 64 | + |
| 65 | +#### `Package:get_install_path()` has been removed. |
| 66 | +`Breaking Change` |
| 67 | + |
| 68 | +This method has been removed to prepare for future changes. |
| 69 | + |
| 70 | +If you're using this method to access an executable, please consider simply using the canonical name of the executable |
| 71 | +as Mason adds these to your `PATH` by default. If you're using the method to access other files inside the package, |
| 72 | +please consider accessing the `$MASON/share` directory instead. |
| 73 | + |
| 74 | +Example: |
| 75 | + |
| 76 | +_Clarification: The `$MASON` environment variable has been available since v1.0.0._ |
| 77 | + |
| 78 | +```lua |
| 79 | +-- 1a. There's no need to reach into the package directory via Package:get_install_path() to access the executable |
| 80 | +print(vim.fn.exepath("kotlin-debug-adapter")) |
| 81 | +-- /Users/william/.local/share/nvim/mason/bin/kotlin-debug-adapter |
| 82 | + |
| 83 | +-- 1b. Alternatively if you've configured Mason to not modify PATH |
| 84 | +print(vim.fn.expand("$MASON/bin/kotlin-debug-adapter")) |
| 85 | +-- /Users/william/.local/share/nvim/mason/bin/kotlin-debug-adapter |
| 86 | + |
| 87 | +-- 2. To access other files inside the package directory, consider accessing them via the share/ directory |
| 88 | +vim.print(vim.fn.globpath("$MASON/share/java-debug-adapter", "*.jar", true, true)) |
| 89 | +-- { "/Users/william/.local/share/nvim/mason/share/java-debug-adapter/com.microsoft.java.debug.plugin-0.53.1.jar", "/Users/william/.local/share/nvim/mason/share/java-debug-adapter/com.microsoft.java.debug.plugin.jar" } |
| 90 | + |
| 91 | +-- 3. If you absolutely need to access the package directory (please consider raising an issue/PR in the registry if possible) |
| 92 | +print(vim.fn.expand("$MASON/packages/kotlin-debug-adapter/adapter/bin/kotlin-debug-adapter")) |
| 93 | +-- /Users/william/.local/share/nvim/mason/packages/kotlin-debug-adapter/adapter/bin/kotlin-debug-adapter |
| 94 | +``` |
| 95 | + |
| 96 | +> [!NOTE] |
| 97 | +> Why was this method removed? The contents of the package directory is not a stable interface and its structure may |
| 98 | +> change without prior notice, for example to host multiple versions of a package. The only stable interfaces on the |
| 99 | +> file system are files available in `bin/`, `share/` and `opt/` - these directories are only subject to breaking |
| 100 | +> changes done by the underlying package itself. |
| 101 | +
|
| 102 | +--- |
| 103 | + |
| 104 | +#### `Package:uninstall(opts, callback)` is now asynchronous. |
| 105 | +`Breaking Change` |
| 106 | + |
| 107 | +This method now provides an asynchronous interface and accepts two new optional arguments `opts` and `callback`. `opts` |
| 108 | +currently doesn't have any valid values other than an empty Lua table `{}`. `callback` is called when the package is |
| 109 | +uninstalled, successfully or not. While the uninstall mechanism under the hood remains synchronous for the time being it |
| 110 | +is not a guarantee going forward and users are recommended to always use the asynchronous version. |
| 111 | + |
| 112 | +Example: |
| 113 | + |
| 114 | +```lua |
| 115 | +local registry = require("mason-registry") |
| 116 | +local pkg = registry.get_package("lua-language-server") |
| 117 | + |
| 118 | +pkg:uninstall({}, function (success, result) |
| 119 | + if success then |
| 120 | + -- Do something on success. |
| 121 | + else |
| 122 | + -- Do something on error. |
| 123 | + end |
| 124 | +end) |
| 125 | +``` |
| 126 | + |
| 127 | +--- |
| 128 | + |
| 129 | +#### `Package:check_new_version()` has been removed. |
| 130 | +`Breaking Change` |
| 131 | + |
| 132 | +`Package:check_new_version()` is replaced by `Package:get_latest_version()`. `Package:get_latest_version()` is a |
| 133 | +synchronous API. |
| 134 | + |
| 135 | +> [!NOTE] |
| 136 | +> Similarly to before, this function returns the package version provided by the currently installed registry version. |
| 137 | +
|
| 138 | +Example: |
| 139 | +```lua |
| 140 | +local registry = require("mason-registry") |
| 141 | +local pkg = registry.get_package("lua-language-server") |
| 142 | +local latest_version = pkg:get_latest_version() |
| 143 | +``` |
| 144 | + |
| 145 | +--- |
| 146 | + |
| 147 | +#### `Package:get_installed_version()` is now synchronous. |
| 148 | +`Breaking Change` |
| 149 | + |
| 150 | +This function no longer accepts a callback. |
| 151 | + |
| 152 | +Example: |
| 153 | +```lua |
| 154 | +local registry = require("mason-registry") |
| 155 | +local pkg = registry.get_package("lua-language-server") |
| 156 | +if pkg:is_installed() then |
| 157 | + local installed_version = pkg:get_installed_version() |
| 158 | +end |
| 159 | +``` |
| 160 | + |
| 161 | +--- |
| 162 | + |
| 163 | +#### `Package:install()` will now error if the package is currently being installed. |
| 164 | +`Breaking Change` |
| 165 | + |
| 166 | +Use the new `Package:is_installing()` method to check whether an installation is already running. |
| 167 | + |
| 168 | +--- |
| 169 | + |
| 170 | +#### `Package:uninstall()` will now error if the package is not already installed. |
| 171 | +`Breaking Change` |
| 172 | + |
| 173 | +Use the new `Package:is_installed()` method to check whether the package is installed. |
| 174 | + |
| 175 | +--- |
| 176 | + |
| 177 | +#### `Package:install(opts, callback)` now accepts a callback. |
| 178 | + |
| 179 | +This optional callback is called by Mason when package installation finishes, successfully or not. |
| 180 | + |
| 181 | +Example: |
| 182 | + |
| 183 | +```lua |
| 184 | +local registry = require("mason-registry") |
| 185 | +local pkg = registry.get_package("lua-language-server") |
| 186 | + |
| 187 | +pkg:install({}, function (success, result) |
| 188 | + if success then |
| 189 | + -- Do something on success. |
| 190 | + else |
| 191 | + -- Do something on error. |
| 192 | + end |
| 193 | +end) |
| 194 | +``` |
| 195 | + |
| 196 | +### Custom registries |
| 197 | + |
| 198 | +v2.0.0 introduces official support for custom registries. Currently supported registry protocols are `github:`, `file:`, |
| 199 | +and `lua:`. Lua-based registries have been reworked, please see https://github.com/mason-org/registry-examples for examples. |
| 200 | + |
| 201 | +Thanks to all sponsors who continue to help finance monthly costs and all 181 contributors of mason.nvim and 246 |
| 202 | +contributors of the core registry! |
| 203 | + |
3 | 204 | ## [1.11.0](https://github.com/williamboman/mason.nvim/compare/v1.10.0...v1.11.0) (2025-02-15)
|
4 | 205 |
|
5 | 206 |
|
|
0 commit comments