Skip to content

Commit 5e3e8ba

Browse files
committed
feat(#194): enhance NovaModule initialization with update notifications
- Add non-blocking update warning for newer NovaModuleTools releases before interactive scaffold questions - Ensure existing .gitignore rules are preserved while adding Nova-managed entries - Update documentation to reflect new behavior in initialization workflows
1 parent 1245214 commit 5e3e8ba

29 files changed

Lines changed: 356 additions & 45 deletions

.github/agents/reviewer.agent.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Review changes for correctness, maintainability, test coverage, workflow safety,
2828
- Flag Nova-managed validation that bypasses `Test-NovaBuild` with direct `Invoke-Pester`.
2929
- Flag any PSScriptAnalyzer rule excludes or suppressions; the code should be fixed instead.
3030
- Flag unresolved ScriptAnalyzer findings from `run.ps1` or `Invoke-ScriptAnalyzerCI.ps1`; they should be fixed instead of deferred.
31+
- Flag every changed or generated text file if they do not exactly have one trailing newline with no extra blank lines at the bottom.
3132

3233
## Inputs to inspect
3334

.github/agents/test-engineer.agent.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Improve or maintain the repository's Pester coverage, coverage-gate behavior, an
1818
- Use `.github/instructions/testing-policy.instructions.md` as the test-design source of truth while shaping `tests/**/*.ps1`.
1919
- Use `.github/instructions/psscriptanalyzer.instructions.md` when changing tests, test helpers, or analyzer/CI helpers so the repo-standard analyzer workflow stays intact.
2020
- Keep CI coverage output compatible with the CodeScene workflow.
21+
- Before handoff, review every changed or generated text file and normalize it to exactly one trailing newline with no extra blank lines at the bottom.
22+
2123

2224
## Inputs to inspect
2325

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
1818
- The generated guidance now requires `docs/<ProjectName>/en-US/*.md` to stay valid PlatyPS help with YAML metadata and build-compatible structure, tells agents to use the documented `New-MarkdownCommandHelp` / `Update-MarkdownCommandHelp` / `Test-MarkdownCommandHelp` workflow instead of replacing command help with plain Markdown that breaks `nova build`, and requires a matching help file for every new public entry point in the same change.
1919
- The generated PowerShell guidance now requires agents to review every changed or generated text file before handoff and normalize the file ending to exactly one trailing newline with no extra blank lines at the bottom.
2020
- When Git is enabled during either scaffold flow, Nova now creates or updates a default `.gitignore` in the generated project root and appends only the missing Nova-managed artifact entries instead of overwriting existing ignore rules.
21+
- `Initialize-NovaModule` and `% nova init` now check for newer NovaModuleTools releases before the first interactive scaffold question and reuse the same non-blocking update warning behavior already used by build.
2122

2223

2324
### Changed

RELEASE_NOTE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This file summarizes public cmdlet, CLI, configuration, and migration changes fo
77
### Added
88
- `Initialize-NovaModule` and `% nova init` now offer an optional Agentic Copilot starter package in both the minimal and example interactive scaffold flows.
99
- The starter package follows a filtered mirror of Nova's maintained agentic guidance so newly scaffolded projects receive a broader Nova-style agentic baseline without Nova-specific surfaces.
10+
- Before the first interactive scaffold question, Nova now also warns when a newer NovaModuleTools release is available by reusing the same non-blocking update warning behavior already used by `build`.
1011

1112
### Changed
1213

docs/NovaModuleTools/en-US/Initialize-NovaModule.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ PS> Initialize-NovaModule [-Path <string>] [-Example] [-WhatIf] [-Confirm] [<Com
2727

2828
`Initialize-NovaModule` creates a new project folder, the standard `src/` layout, and a starter `project.json` file.
2929

30-
The command collects project details interactively, including the module name, description, version, author, minimum PowerShell version, Git initialization, and an optional Agentic Copilot starter package. When Git initialization is enabled, Nova also creates or updates a default `.gitignore` in the generated project root so common local and CI artifact paths such as `artifacts/`, `dist/`, `run.ps1`, and `reload.ps1` are ignored from the start. Existing `.gitignore` files are preserved and only receive the missing Nova-managed entries. When you enable the Agentic package, Nova also asks for a project short name used in generated guidance placeholders such as `Invoke-<ShortName>*`; for NovaModuleTools the short name is `Nova`, but it could also have been `NMT`. The Agentic package follows Nova's maintained agentic guidance through a filtered starter mirror, including Nova build/test/package expectations, `project.json`
30+
The command collects project details interactively, including the module name, description, version, author, minimum PowerShell version, Git initialization, and an optional Agentic Copilot starter package. Before the first interactive question, Nova checks whether a newer `NovaModuleTools` release is available and warns without blocking the scaffold flow. When Git initialization is enabled, Nova also creates or updates a default `.gitignore` in the generated project root so common local and CI artifact paths such as `artifacts/`, `dist/`, `run.ps1`, and `reload.ps1` are ignored from the start. Existing `.gitignore` files are preserved and only receive the missing Nova-managed entries. When you enable the Agentic package, Nova also asks for a project short name used in generated guidance placeholders such as `Invoke-<ShortName>*`; for NovaModuleTools the short name is `Nova`, but it could also have been
31+
`NMT`. The Agentic package follows Nova's maintained agentic guidance through a filtered starter mirror, including Nova build/test/package expectations, `project.json`
3132
`Manifest.PowerShellHostVersion` compatibility guidance, strict ScriptAnalyzer guidance without excluded rules, generated `dist` module files, command-help ownership, source-mirrored test guidance, guidance that ScriptAnalyzer findings reported by
3233
`run.ps1` must be fixed before handoff, explicit PSScriptAnalyzer workflow guidance for `./scripts/build/Invoke-ScriptAnalyzerCI.ps1`, `./run.ps1`, and focused `Invoke-ScriptAnalyzer` usage, explicit public/private PowerShell file ownership rules, best-effort source/helper-script maintainability guidance plus separate test-design guidance delivered through Agentic Copilot files, explicit valid-PlatyPS help guidance for `docs/<ProjectName>/en-US/*.md` that uses `New-MarkdownCommandHelp`, `Update-MarkdownCommandHelp`, and `Test-MarkdownCommandHelp`, and a strict file-ending rule for changed or generated text files. For the standard scaffold, the interactive flow also includes optional basic Pester support.
3334

@@ -37,7 +38,7 @@ Use this command when you want to start a new module in the NovaModuleTools stru
3738

3839
Use `-Path` when you want to create the project under a specific base directory. Positional path syntax is no longer supported.
3940

40-
Use `-Example` when you want the scaffold to start from the packaged example project instead of the minimal default layout. The example flow keeps the example source, resource, and test files, skips the Pester enable/disable question, and applies the interactive metadata values to the copied `project.json`. The standard and example flows share the same inline validation and retry behavior for interactive answers, including the optional Agentic Copilot setup prompt after the Git question. When Git is enabled in either flow, Nova also ensures the generated project root has the default `.gitignore` entries for local and CI artifacts without overwriting any existing `.gitignore` content. When you answer `Yes`, Nova asks for the short project name, adds the same starter package to either scaffold style, and merges the example README instead of replacing it with the generic starter README outright.
41+
Use `-Example` when you want the scaffold to start from the packaged example project instead of the minimal default layout. The example flow keeps the example source, resource, and test files, skips the Pester enable/disable question, and applies the interactive metadata values to the copied `project.json`. The standard and example flows share the same upfront Nova update warning, inline validation and retry behavior for interactive answers, and optional Agentic Copilot setup prompt after the Git question. When Git is enabled in either flow, Nova also ensures the generated project root has the default `.gitignore` entries for local and CI artifacts without overwriting any existing `.gitignore` content. When you answer `Yes`, Nova asks for the short project name, adds the same starter package to either scaffold style, and merges the example README instead of replacing it with the generic starter README outright.
4142

4243
This command supports `-WhatIf` and `-Confirm` through PowerShell `SupportsShouldProcess`. Use `-WhatIf` to preview the scaffold target after the interactive answers have been collected, without creating folders, writing `project.json`, or initializing Git.
4344

docs/commands.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,12 @@ <h3>Start a new project</h3>
174174
<div class="surface-note" data-command-visibility="powershell">
175175
<p><strong>Cmdlet:</strong> <code>Initialize-NovaModule</code></p>
176176
</div>
177-
<p>Create the minimal scaffold or the example scaffold for a new module project. When Git is
178-
enabled, Nova also creates or updates a default <code>.gitignore</code> in the generated
179-
project root so common local and CI artifact paths are ignored without overwriting existing
180-
rules. Both interactive flows can also add the optional Agentic Copilot starter package,
177+
<p>Create the minimal scaffold or the example scaffold for a new module project. Before the
178+
first interactive question, Nova checks whether a newer NovaModuleTools release is
179+
available and warns without blocking the scaffold flow. When Git is enabled, Nova also
180+
creates or updates a default <code>.gitignore</code> in the generated project root so
181+
common local and CI artifact paths are ignored without overwriting existing rules. Both
182+
interactive flows can also add the optional Agentic Copilot starter package,
181183
which follows Nova's maintained agentic guidance through a filtered starter mirror, including Nova build/test
182184
expectations, <code>project.json</code> <code>Manifest.PowerShellHostVersion</code>
183185
compatibility guidance, strict ScriptAnalyzer guidance without excluded rules, generated

docs/core-workflows.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,12 @@ <h2>Create the project</h2>
124124
path syntax such as <code>% nova init ~/Work</code>.</p>
125125
</div>
126126
<p>Both scaffold styles ask the same core project questions, and both now offer an optional Agentic
127-
Copilot starter package after the Git prompt. When you enable Git in either scaffold style, Nova
128-
also creates or updates a default <code>.gitignore</code> in the generated project root so common
129-
local and CI artifact paths are ignored without overwriting existing rules. The Agentic prompt
130-
defaults to <code>No</code>, and the package follows Nova's maintained agentic guidance through a
127+
Copilot starter package after the Git prompt. Before the first question, Nova also checks whether a
128+
newer NovaModuleTools release is available and warns without blocking the scaffold flow. When you
129+
enable Git in either scaffold style, Nova also creates or updates a default <code>.gitignore</code>
130+
in the generated project root so common local and CI artifact paths are ignored without
131+
overwriting existing rules. The Agentic prompt defaults to <code>No</code>, and the package
132+
follows Nova's maintained agentic guidance through a
131133
filtered starter mirror, including
132134
Nova build/test/package expectations, <code>project.json</code>
133135
<code>Manifest.PowerShellHostVersion</code> compatibility guidance, strict ScriptAnalyzer guidance

docs/getting-started.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ <h2>4. Scaffold the packaged example</h2>
195195
</div>
196196
<p>Nova asks for the project name, description, version, author, minimum PowerShell version, whether
197197
Git should be initialized, and whether Nova should add the optional Agentic Copilot starter package.
198+
Before the first question, Nova also checks whether a newer NovaModuleTools release is available and
199+
warns without blocking the scaffold flow.
198200
When you enable Git, Nova also creates or updates a default <code>.gitignore</code> in the new
199201
project root so common local and CI artifact paths start ignored without overwriting existing ignore
200202
rules.

src/private/build/InvokeNovaBuildWorkflow.ps1

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function Invoke-NovaBuildWorkflow {
1515
Build-Manifest -ProjectInfo $projectInfo
1616
Build-Help -ProjectInfo $projectInfo
1717
Copy-ProjectResource -ProjectInfo $projectInfo
18-
Invoke-NovaBuildUpdateNotificationSafely
18+
Invoke-NovaModuleUpdateNotificationSafely
1919

2020
if ($continuousIntegrationRequested) {
2121
$null = Import-NovaBuiltModuleForCi -ProjectInfo $projectInfo
@@ -35,13 +35,3 @@ function Invoke-NovaBuildDuplicateValidation {
3535
Assert-BuiltModuleHasNoDuplicateFunctionName -ProjectInfo $ProjectInfo
3636
}
3737

38-
function Invoke-NovaBuildUpdateNotificationSafely {
39-
[CmdletBinding()]
40-
param()
41-
42-
try {
43-
Invoke-NovaBuildUpdateNotification
44-
} catch {
45-
$null = $_
46-
}
47-
}

src/private/cli/ConfirmNovaCliAction.ps1

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,27 @@ function Invoke-NovaCliConsoleReadKey {
4343

4444
function Invoke-NovaCliNativeConsoleReadKey {
4545
[CmdletBinding()]
46-
param([scriptblock]$Reader = {[Console]::ReadKey($true)})
46+
param([scriptblock]$Reader)
47+
48+
if ($null -eq $Reader) {
49+
$Reader = Get-NovaCliNativeConsoleReadKeyReader
50+
}
4751

4852
return & $Reader
4953
}
5054

55+
function Get-NovaCliNativeConsoleReadKeyReader {
56+
[CmdletBinding()]
57+
param()
58+
59+
return [scriptblock]::Create('[Console]::ReadKey($true)')
60+
}
61+
5162
function Get-NovaCliConsoleReadKeyReader {
5263
[CmdletBinding()]
5364
param()
5465

55-
return {Invoke-NovaCliNativeConsoleReadKey}
66+
return [scriptblock]::Create('Invoke-NovaCliNativeConsoleReadKey')
5667
}
5768

5869
function Read-NovaCliPromptKey {

0 commit comments

Comments
 (0)