aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core/package/version-check.lua
Commit message (Collapse)AuthorAgeFilesLines
* refactor!: consolidate Lua registry sources and the Package API (#1498)William Boman2025-02-161-80/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | **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. <details> <summary>To handle these breaking changes in plugins, leverage the `mason.version` module, for example:</summary> ```lua local mason_version = require("mason.version") local registry = require("mason-registry") local pkg = registry.get_package("rust-analyzer") if mason_version.MAJOR_VERSION < 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 ``` </details> --- <details> <summary>This change also introduces breaking changes for Lua registry sources, by consolidating the package schema with the registry.</summary> 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", }, } ``` </details>
* style: enforce import order (#1092)William Boman2023-03-121-1/+1
| | | | | * chore(workflows): update dependencies * style: enforce import order
* feat(npm): speed up checking for new versions (#530)William Boman2022-10-091-1/+8
|
* fix(jdtls): download milestone versions instead of snapshots (#87)William Boman2022-07-171-18/+0
|
* refactor: add mason-schemas and mason-core modules (#29)William Boman2022-07-081-0/+91
* refactor: add mason-schemas and move generated filetype map to mason-lspconfig * refactor: add mason-core module