Skip to content

Commit db83999

Browse files
🩹 [Patch]: Name the helper module after the action (Resolve-PSModuleVersion.Helpers) (#8)
Aligns the helper module with the action helper-module naming standard: name it after the action (`Resolve-PSModuleVersion.Helpers`) instead of a generic name. PR #4 introduced the interim name `ResolveVersion` to fix the `Helpers` collision; this brings it to the ecosystem-wide convention (`<Action>.Helpers`) now that the standard is in place. ## Changes - `scripts/ResolveVersion.psm1` → `scripts/Resolve-PSModuleVersion.Helpers.psm1` - `tests/ResolveVersion.Tests.ps1` → `tests/Resolve-PSModuleVersion.Helpers.Tests.ps1` - `tests/ResolveVersion.Tests.Data.psd1` → `tests/Resolve-PSModuleVersion.Helpers.Tests.Data.psd1` - Updated the entry-script import (`scripts/main.ps1`), the test module import, the test data-file path, and the two `Mock -ModuleName` references. Kept the framework `Import-Module -Name 'Helpers'`. No runtime logic changed (100% file rename + reference updates). ## Validation Tests pass 131/131 under a simulated `Helpers` name collision (a second module named `Helpers` loaded before Invoke-Pester). PSScriptAnalyzer clean apart from the pre-existing `PSAvoidUsingWriteHost` warnings (unchanged module body). Part of PSModule/Process-PSModule#364. Standard: the "Name helper modules after the action" rule in the GitHub Actions coding standard (MSXOrg/docs#24).
1 parent d53326c commit db83999

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

File renamed without changes.

ā€Žscripts/main.ps1ā€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ param()
44
$PSStyle.OutputRendering = 'Ansi'
55

66
Import-Module -Name 'Helpers' -Force
7-
Import-Module -Name "$PSScriptRoot/ResolveVersion.psm1" -Force
7+
Import-Module -Name "$PSScriptRoot/Resolve-PSModuleVersion.Helpers.psm1" -Force
88

99
$actionInput = Read-ActionInput
1010
$config = Get-PublishConfiguration -SettingsJson $actionInput.SettingsJson
File renamed without changes.

tests/ResolveVersion.Tests.ps1 renamed to tests/Resolve-PSModuleVersion.Helpers.Tests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
param()
1010

1111
# Load test data at script scope so it is available during Pester discovery (-ForEach)
12-
$TestData = Import-PowerShellDataFile -Path "$PSScriptRoot/ResolveVersion.Tests.Data.psd1"
12+
$TestData = Import-PowerShellDataFile -Path "$PSScriptRoot/Resolve-PSModuleVersion.Helpers.Tests.Data.psd1"
1313

1414
BeforeAll {
1515
# Install PSSemVer for version handling
@@ -25,7 +25,7 @@ BeforeAll {
2525
}
2626

2727
# Import the module under test
28-
Import-Module -Name "$PSScriptRoot/../scripts/ResolveVersion.psm1" -Force
28+
Import-Module -Name "$PSScriptRoot/../scripts/Resolve-PSModuleVersion.Helpers.psm1" -Force
2929
}
3030

3131
Describe 'Resolve-ReleaseDecision' {
@@ -92,7 +92,7 @@ Describe 'Resolve-ReleaseDecision' {
9292

9393
Describe 'Get-NextModuleVersion' {
9494
BeforeAll {
95-
Mock -CommandName Find-PSResource -ModuleName ResolveVersion -MockWith { @() }
95+
Mock -CommandName Find-PSResource -ModuleName 'Resolve-PSModuleVersion.Helpers' -MockWith { @() }
9696
$emptyReleases = @([PSCustomObject]@{ tagName = 'v0.0.0'; isLatest = $false; isPrerelease = $false })
9797
}
9898

@@ -133,7 +133,7 @@ Describe 'Get-NextModuleVersion' {
133133

134134
Describe 'End-to-end: Resolve-ReleaseDecision + Get-NextModuleVersion' {
135135
BeforeAll {
136-
Mock -CommandName Find-PSResource -ModuleName ResolveVersion -MockWith { @() }
136+
Mock -CommandName Find-PSResource -ModuleName 'Resolve-PSModuleVersion.Helpers' -MockWith { @() }
137137
$emptyReleases = @([PSCustomObject]@{ tagName = 'v0.0.0'; isLatest = $false; isPrerelease = $false })
138138
}
139139

0 commit comments

Comments
Ā (0)