Commit 5d65476
🪲 [Fix]: Module import no longer fails when a newer Admin version is installed (#59)
Importing the `Fonts` module no longer fails when a newer version of the
`Admin` dependency is installed. Previously, the `#Requires` directives
pinned an exact version (`RequiredVersion = '1.1.6'`), which caused
`Import-Module Fonts` to error out if only a newer version of `Admin`
was present. The directives now specify a major-pinned range using
`ModuleVersion` and `MaximumVersion`, accepting any `Admin` version from
`1.1.6` up to (but not including) `2.0.0`.
- Fixes #58
## Fixed: Module import fails with newer Admin dependency
The three public functions (`Get-Font`, `Install-Font`,
`Uninstall-Font`) used `RequiredVersion` in their `#Requires -Modules`
directive, demanding an exact version match for the `Admin` module. This
caused `Import-Module Fonts` to fail when only a newer version of
`Admin` was installed.
The directives now use a **major-pinned range** — `ModuleVersion` sets
the minimum acceptable version, and `MaximumVersion` caps at `1.999.999`
to prevent a future `Admin` v2.0.0 (with potential breaking changes)
from being used. Any version of `Admin` from `1.1.6` through `1.x` will
satisfy the requirement.
```powershell
# Before (exact pin — fails if 1.1.6 is not installed)
#Requires -Modules @{ ModuleName = 'Admin'; RequiredVersion = '1.1.6' }
# After (major-pinned range — 1.1.6 through 1.x accepted)
#Requires -Modules @{ ModuleName = 'Admin'; ModuleVersion = '1.1.6'; MaximumVersion = '1.999.999' }
```
## Technical Details
- Changed `RequiredVersion` to `ModuleVersion` + `MaximumVersion` in
`#Requires -Modules` directive in three files:
- `src/functions/public/Get-Font.ps1`
- `src/functions/public/Install-Font.ps1`
- `src/functions/public/Uninstall-Font.ps1`
- Minimum version stays at `1.1.6` (unchanged from the original
`RequiredVersion` value).
- `MaximumVersion = '1.999.999'` added to cap at the `1.x` major version
range, preventing breakage from a future `Admin` v2.0.0.
- **Implementation plan progress**: Core change tasks (all 3 files)
completed. Verification tasks remain for CI.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>1 parent 38114b7 commit 5d65476
3 files changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
0 commit comments