aboutsummaryrefslogtreecommitdiffstats
path: root/tests/mason-core/installer/context_spec.lua
Commit message (Collapse)AuthorAgeFilesLines
* refactor(registry): change lua registries to not instantiate Package themselvesWilliam Boman2025-05-021-5/+0
| | | | | | | | 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.
* feat(context): add ctx:await()William Boman2025-02-191-0/+37
|
* refactor!: change Package APIWilliam Boman2025-02-191-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 -> 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) ```
* refactor!: refactor installer internals and add new Package class methods ↵William Boman2025-02-191-24/+22
| | | | | | | | | | | | | | | | | | | (#1523) 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.
* refactor!: remove old managers (#1497)William Boman2025-02-161-5/+3
|
* fix(context): don't write exec wrapper file if it already exists (#1261)William Boman2023-04-261-0/+44
|
* style: enforce import order (#1092)William Boman2023-03-121-2/+2
| | | | | * chore(workflows): update dependencies * style: enforce import order
* feat(InstallContext): add strict_mode flag (#1055)William Boman2023-03-051-1/+0
| | | Also add some more ctx.fs methods.
* feat(platform): accept darwin (#743)William Boman2022-12-081-0/+1
| | | | | Mac systems are generally referred to as the Darwin OS. For all intents and purposes, "mac" and "darwin" can be used interchangeably (although darwin will be preferred going forward).
* feat: more competent platform detection (#436)William Boman2022-09-171-4/+4
|
* refactor: add ctx:write_php_exec_wrapper utility (#409)William Boman2022-09-121-0/+35
|
* fix(installer): use /usr/bin/env bash shebang (#315)William Boman2022-08-191-1/+1
| | | Fixes #308.
* test(installer): add spec files for context and linker (#314)William Boman2022-08-191-0/+175
* feat(installer): don't write exec wrappers for targets that don't exist Just a precaution to avoid writing broken executables. * test(installer): add spec files for context and linker