Skip to content

Commit c12b905

Browse files
committed
fix: update CHANGELOG and improve CLI help consistency
- Refactor CHANGELOG for clarity and formatting consistency - Enhance CLI help output to ensure consistent option spellings - Add tests for default console reader behavior in Invoke-NovaCliNativeConsoleReadKey
1 parent 511ff5a commit c12b905

3 files changed

Lines changed: 60 additions & 21 deletions

File tree

CHANGELOG.md

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5959
- Add `Deploy-NovaPackage` and `% nova deploy` for raw HTTP package uploads that stay separate from PowerShell
6060
repository publishing.
6161
- Package upload resolves `-Url`, `Package.RepositoryUrl`, or named `Package.Repositories` targets and can merge
62-
generic headers/auth settings.
62+
generic headers/auth settings.
6363
- Package upload now discovers all matching artifacts for the selected package types, including versioned and
6464
`latest` files in the configured package output directory.
6565
- Add opt-in skip-test support to the package, publish, and release workflows for CI/CD-oriented delivery paths where
6666
tests already ran earlier in the pipeline.
67-
68-
### Fixed
69-
70-
- Fix unsupported `nova` help invocations so they now return Nova's structured CLI validation error instead of a
71-
PowerShell parameter-binding failure.
72-
- Keep manifest/package helper edge cases aligned with their intended behavior.
73-
- Manifest settings resolution now accepts ordered dictionary metadata shapes in addition to plain hashtables.
74-
- `New-NovaPackageArtifacts` now accepts an empty metadata list and returns an empty artifact result instead of
75-
failing during parameter binding.
7667
- Centralize delivery configuration resolution so raw package upload, update notification settings, and PSGallery
7768
publishing now follow one explicit precedence model without surfacing configured secrets in error text.
7869
- Raw upload now resolves command overrides before named repository settings, then package defaults.
@@ -126,8 +117,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
126117
- `% nova --help <command>` and `% nova -h <command>` now show long CLI help.
127118
- Long command help now includes the matching public GitHub Pages guide URL for the selected command, while short help
128119
stays focused on command syntax and options.
129-
- CLI help no longer delegates to PowerShell `Get-Help` and now consistently shows CLI option spellings such as
130-
`--repository` and `-r`.
120+
- CLI help no longer delegates to PowerShell `Get-Help` and now consistently shows CLI option spellings such as
121+
`--repository` and `-r`.
131122
- **BREAKING CHANGE**: Rename the public Nova scaffold cmdlets.
132123
- `New-NovaModule``Initialize-NovaModule`
133124
- No compatibility aliases are exported for the retired cmdlet names or CLI subcommands.
@@ -191,11 +182,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
191182

192183
### Added
193184
- Project settings:
194-
- `BuildRecursiveFolders` (default `true`): recursive discovery for `src/classes`, `src/private` and `tests`.
195-
- `SetSourcePath` (default `true`): include `# Source: <relative path>` before each concatenated source file in generated `dist/<Project>/<Project>.psm1`.
196-
- `FailOnDuplicateFunctionNames` (default `true`): fail build when duplicate top-level function names exist in generated `dist/<Project>/<Project>.psm1`.
197-
- Missing values for these settings are now treated as `true`.
198-
- The rebranded `NovaModuleTools` module now uses its own module `GUID`.
185+
- `BuildRecursiveFolders` (default `true`): recursive discovery for `src/classes`, `src/private` and `tests`.
186+
- `SetSourcePath` (default `true`): include `# Source: <relative path>` before each concatenated source file in
187+
generated `dist/<Project>/<Project>.psm1`.
188+
- `FailOnDuplicateFunctionNames` (default `true`): fail build when duplicate top-level function names exist in
189+
generated `dist/<Project>/<Project>.psm1`.
190+
- Missing values for these settings are now treated as `true`.
191+
- The rebranded `NovaModuleTools` module now uses its own module `GUID`.
199192

200193
### Changed
201194
- Build determinism: files are processed in a deterministic order by relative path (case-insensitive), and load order is always `classes → public → private`.
@@ -224,13 +217,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
224217
- Now supports preview tag in Update-NovaModuleVersion
225218
- Now supports semver naming in both project.json and modulemanifest
226219
- Module build supports `preview` or `prerelease` tag
227-
- Preview version looks like `1.2.3-preview`
220+
- Preview version looks like `1.2.3-preview`
228221

229222
## [1.1.0] - 2025-08-28
230223

231224
## Added
232225

233-
- Now Module manifest includes `AliasesToExport`. This helps loading aliases without explicitly importing modules to session.
226+
- Now Module manifest includes `AliasesToExport`. This helps loading aliases without explicitly importing modules to
227+
session.
234228
- thanks to @djs-zmtc for suggesting the feature
235229

236230
## [1.0.0] - 2025-03-11

src/private/cli/ConfirmNovaCliAction.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ function Invoke-NovaCliConsoleReadKey {
4242
}
4343

4444
function Invoke-NovaCliNativeConsoleReadKey {
45-
[CmdletBinding()]
46-
param([scriptblock]$Reader = {[Console]::ReadKey($true)})
45+
[CmdletBinding()] param([scriptblock]$Reader)
46+
if ($null -eq $Reader) {
47+
return [Console]::ReadKey($true)
48+
}
4749

4850
return & $Reader
4951
}

tests/CliHelperCoverage.Tests.ps1

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,47 @@ Describe 'Targeted coverage for smaller CLI helper internals' {
146146
Assert-MockCalled Invoke-NovaCliNativeConsoleReadKey -Times 1
147147
}
148148
}
149+
150+
It 'Invoke-NovaCliNativeConsoleReadKey uses the default console reader when no override is provided' {
151+
$runnerPath = Join-Path $TestDrive 'Invoke-NovaCliNativeConsoleReadKey.Runner.ps1'
152+
$stdinPath = Join-Path $TestDrive 'Invoke-NovaCliNativeConsoleReadKey.stdin.txt'
153+
$stdoutPath = Join-Path $TestDrive 'Invoke-NovaCliNativeConsoleReadKey.stdout.txt'
154+
$stderrPath = Join-Path $TestDrive 'Invoke-NovaCliNativeConsoleReadKey.stderr.txt'
155+
Set-Content -LiteralPath $stdinPath -Value '' -Encoding utf8 -NoNewline
156+
Set-Content -LiteralPath $runnerPath -Encoding utf8 -Value @"
157+
`$module = Import-Module '$script:distModuleDir' -Force -PassThru
158+
159+
try {
160+
& `$module {
161+
Invoke-NovaCliNativeConsoleReadKey | Out-Null
162+
}
163+
164+
Write-Output 'NO_THROW'
165+
exit 1
166+
}
167+
catch {
168+
Write-Output `$_.FullyQualifiedErrorId
169+
Write-Output `$_.Exception.Message
170+
exit 0
171+
}
172+
"@
173+
174+
$process = Start-Process pwsh -ArgumentList @('-NoLogo', '-NoProfile', '-File', $runnerPath) `
175+
-RedirectStandardInput $stdinPath `
176+
-RedirectStandardOutput $stdoutPath `
177+
-RedirectStandardError $stderrPath `
178+
-Wait `
179+
-PassThru
180+
$output = @(
181+
if (Test-Path -LiteralPath $stdoutPath) {
182+
Get-Content -LiteralPath $stdoutPath
183+
}
184+
if (Test-Path -LiteralPath $stderrPath) {
185+
Get-Content -LiteralPath $stderrPath
186+
}
187+
)
188+
189+
$process.ExitCode | Should -Be 0 -Because ($output -join [Environment]::NewLine)
190+
($output -join [Environment]::NewLine) | Should -Match 'Cannot read keys when either application does not have a console or when console input has been redirected'
191+
}
149192
}

0 commit comments

Comments
 (0)