Skip to content

Commit 2b8aab6

Browse files
feat(delivery): ✨ standardize manifest delivery metadata to PrivateData.PSData.Delivery/Repository
* Replace legacy `PSPublishModuleDelivery` references in docs and cmdlets with `PrivateData.PSData.Delivery`. * Update `New-PersonalManifest.ps1` to emit a structured `Delivery` node and an optional `Repository` node (branch/paths), and include `Delivery`/`Repository` in validated PrivateData entries. * Update public cmdlets (`Install-ProjectDocumentation`, `Show-ProjectDocumentation`) and documentation to read from the new nodes. * Fix minor typo in `Build-Module.ps1` ("rmeove" → "remove").
1 parent c388fb4 commit 2b8aab6

8 files changed

+47
-25
lines changed

Module/Build/Build-Module.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# most modules should be run via PSD1 or by it's name (which in the background uses PD1)
44

55
# This version is for local building
6-
# We need to rmeove library before we start, as it may contain old files, which will be in use once PSD1 loads
6+
# We need to remove library before we start, as it may contain old files, which will be in use once PSD1 loads
77
# This is only required for PSPublisModule, as it's the only module that is being built by itself
88
Remove-Item -Path "C:\Support\GitHub\PSPublishModule\Module\Lib" -Recurse -Force -ErrorAction SilentlyContinue
99

Module/Docs/Install-ProjectDocumentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Install-ProjectDocumentation [-Module <PSModuleInfo>] [-RequiredVersion <Version
2828

2929
## DESCRIPTION
3030
Copies the contents of a module's Internals folder (or the path defined in
31-
PrivateData.PSData.PSPublishModuleDelivery) to a destination outside of
31+
PrivateData.PSData.Delivery) to a destination outside of
3232
$env:PSModulePath, including subfolders such as Scripts, Docs, Binaries, Config.
3333
When -IncludeRootReadme/-IncludeRootChangelog/-IncludeRootLicense are enabled in
3434
New-ConfigurationDelivery, root README/CHANGELOG/LICENSE are also copied.

Module/Docs/New-ConfigurationDelivery.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ New-ConfigurationDelivery [-Enable] [[-InternalsPath] <String>] [-IncludeRootRea
2323

2424
## DESCRIPTION
2525
Adds Delivery options to the PSPublishModule configuration so the build embeds
26-
discovery metadata in the manifest (PrivateData.PSData.PSPublishModuleDelivery)
26+
runtime metadata in the manifest (PrivateData.PSData.Delivery and PrivateData.PSData.Repository)
2727
and so the Internals folder is easy to find post-install by helper cmdlets
2828
such as Install-ModuleDocumentation.
2929

@@ -36,7 +36,7 @@ directory is physically included in the shipped module and discoverable later.
3636
### EXAMPLE 1
3737
```
3838
New-ConfigurationDelivery -Enable -InternalsPath 'Internals' -IncludeRootReadme -IncludeRootChangelog
39-
Emits Options.Delivery and causes PrivateData.PSData.PSPublishModuleDelivery to be written in the manifest.
39+
Emits Options.Delivery and causes PrivateData.PSData.Delivery/Repository to be written in the manifest.
4040
```
4141

4242
### EXAMPLE 2

Module/Docs/Show-ProjectDocumentation.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Show-ProjectDocumentation [-RequiredVersion <Version>] [-DocsPath <String>] [-Re
3535

3636
## DESCRIPTION
3737
Finds a module (by name or PSModuleInfo) and renders README/CHANGELOG from the module root
38-
or from its Internals folder (as defined in PrivateData.PSData.PSPublishModuleDelivery).
38+
or from its Internals folder (as defined in PrivateData.PSData.Delivery).
3939
You can also point directly to a docs folder via -DocsPath (e.g., output of Install-ModuleDocumentation).
4040

4141
## EXAMPLES
@@ -220,7 +220,7 @@ Accept wildcard characters: False
220220
```
221221
222222
### -Intro
223-
Show introduction text defined in PrivateData.PSData.PSPublishModuleDelivery.IntroText when available.
223+
Show introduction text defined in PrivateData.PSData.Delivery.IntroText when available.
224224
If not defined,
225225
falls back to README resolution (root vs Internals honoring -PreferInternals).
226226
@@ -237,7 +237,7 @@ Accept wildcard characters: False
237237
```
238238
239239
### -Upgrade
240-
Show upgrade text defined in PrivateData.PSData.PSPublishModuleDelivery.UpgradeText when available.
240+
Show upgrade text defined in PrivateData.PSData.Delivery.UpgradeText when available.
241241
If not defined,
242242
looks for an UPGRADE* file; otherwise throws.
243243
@@ -271,7 +271,7 @@ Accept wildcard characters: False
271271
```
272272
273273
### -Links
274-
Print ImportantLinks defined in PrivateData.PSData.PSPublishModuleDelivery after the selected documents.
274+
Print ImportantLinks defined in PrivateData.PSData.Delivery after the selected documents.
275275
276276
```yaml
277277
Type: SwitchParameter

Module/Private/New-PersonalManifest.ps1

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function New-PersonalManifest {
9999
if ($Data.Path) {
100100
$Data.Remove('Path')
101101
}
102-
$ValidateEntriesPrivateData = @('Tags', 'LicenseUri', 'ProjectURI', 'IconUri', 'ReleaseNotes', 'Prerelease', 'RequireLicenseAcceptance', 'ExternalModuleDependencies', 'PSPublishModuleDelivery')
102+
$ValidateEntriesPrivateData = @('Tags', 'LicenseUri', 'ProjectURI', 'IconUri', 'ReleaseNotes', 'Prerelease', 'RequireLicenseAcceptance', 'ExternalModuleDependencies', 'Delivery', 'Repository')
103103
foreach ($Entry in [string[]] $Data.Keys) {
104104
if ($Entry -in $ValidateEntriesPrivateData) {
105105
$Data.PrivateData.PSData.$Entry = $Data.$Entry
@@ -124,9 +124,31 @@ function New-PersonalManifest {
124124
if ($Configuration.Steps.PublishModule.Prerelease) {
125125
$Data.PrivateData.PSData.Prerelease = $Configuration.Steps.PublishModule.Prerelease
126126
}
127-
# Emit delivery metadata when provided
127+
# Emit Delivery/Repository metadata (runtime-only) when provided
128128
if ($Configuration.Options.Delivery -and $Configuration.Options.Delivery.Enable) {
129-
$Data.PrivateData.PSData.PSPublishModuleDelivery = $Configuration.Options.Delivery
129+
$deliveryCfg = $Configuration.Options.Delivery
130+
# Build runtime Delivery node
131+
$deliveryNode = [ordered] @{
132+
InternalsPath = $deliveryCfg.InternalsPath
133+
ImportantLinks = $deliveryCfg.ImportantLinks
134+
IntroText = $deliveryCfg.IntroText
135+
UpgradeText = $deliveryCfg.UpgradeText
136+
IntroFile = $deliveryCfg.IntroFile
137+
UpgradeFile = $deliveryCfg.UpgradeFile
138+
DocumentationOrder = $deliveryCfg.DocumentationOrder
139+
}
140+
Remove-EmptyValue -Hashtable $deliveryNode
141+
$Data.PrivateData.PSData.Delivery = $deliveryNode
142+
143+
# Build Repository node (branch/paths only)
144+
$repositoryNode = [ordered] @{
145+
Branch = $deliveryCfg.RepositoryBranch
146+
Paths = $deliveryCfg.RepositoryPaths
147+
}
148+
Remove-EmptyValue -Hashtable $repositoryNode
149+
if ($repositoryNode.Count -gt 0) {
150+
$Data.PrivateData.PSData.Repository = $repositoryNode
151+
}
130152
}
131153
if ($TemporaryManifest.ExternalModuleDependencies) {
132154
# Add External Module Dependencies

Module/Public/Install-ProjectDocumentation.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function Install-ProjectDocumentation {
55
66
.DESCRIPTION
77
Copies the contents of a module's Internals folder (or the path defined in
8-
PrivateData.PSData.PSPublishModuleDelivery) to a destination outside of
8+
PrivateData.PSData.Delivery) to a destination outside of
99
$env:PSModulePath, including subfolders such as Scripts, Docs, Binaries, Config.
1010
When -IncludeRootReadme/-IncludeRootChangelog/-IncludeRootLicense are enabled in
1111
New-ConfigurationDelivery, root README/CHANGELOG/LICENSE are also copied.
@@ -152,7 +152,7 @@ function Install-ProjectDocumentation {
152152
}
153153

154154
$manifest = Test-ModuleManifest -Path $manifestPath
155-
$delivery = $manifest.PrivateData.PSData.PSPublishModuleDelivery
155+
$delivery = $manifest.PrivateData.PSData.Delivery
156156

157157
$internalsRel = if ($delivery -and $delivery.InternalsPath) { [string]$delivery.InternalsPath } else { 'Internals' }
158158
$includeReadme = if ($null -ne $delivery.IncludeRootReadme) { [bool]$delivery.IncludeRootReadme } else { $true }

Module/Public/New-ConfigurationDelivery.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function New-ConfigurationDelivery {
55
66
.DESCRIPTION
77
Adds Delivery options to the PSPublishModule configuration so the build embeds
8-
discovery metadata in the manifest (PrivateData.PSData.PSPublishModuleDelivery)
8+
runtime metadata in the manifest (PrivateData.PSData.Delivery and PrivateData.PSData.Repository)
99
and so the Internals folder is easy to find post-install by helper cmdlets
1010
such as Install-ModuleDocumentation.
1111
@@ -74,7 +74,7 @@ function New-ConfigurationDelivery {
7474
7575
.EXAMPLE
7676
PS> New-ConfigurationDelivery -Enable -InternalsPath 'Internals' -IncludeRootReadme -IncludeRootChangelog
77-
Emits Options.Delivery and causes PrivateData.PSData.PSPublishModuleDelivery to be written in the manifest.
77+
Emits Options.Delivery and causes PrivateData.PSData.Delivery/Repository to be written in the manifest.
7878
7979
.EXAMPLE
8080
PS> New-ConfigurationInformation -IncludeAll 'Internals\'

Module/Public/Show-ProjectDocumentation.ps1

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ function Show-ProjectDocumentation {
55
66
.DESCRIPTION
77
Finds a module (by name or PSModuleInfo) and renders README/CHANGELOG from the module root
8-
or from its Internals folder (as defined in PrivateData.PSData.PSPublishModuleDelivery).
8+
or from its Internals folder (as defined in PrivateData.PSData.Delivery).
99
You can also point directly to a docs folder via -DocsPath (e.g., output of Install-ModuleDocumentation).
1010
1111
.PARAMETER Name
@@ -32,19 +32,19 @@ function Show-ProjectDocumentation {
3232
the chosen area (root vs Internals).
3333
3434
.PARAMETER Intro
35-
Show introduction text defined in PrivateData.PSData.PSPublishModuleDelivery.IntroText when available. If not defined,
35+
Show introduction text defined in PrivateData.PSData.Delivery.IntroText when available. If not defined,
3636
falls back to README resolution (root vs Internals honoring -PreferInternals).
3737
3838
.PARAMETER Upgrade
39-
Show upgrade text defined in PrivateData.PSData.PSPublishModuleDelivery.UpgradeText when available. If not defined,
39+
Show upgrade text defined in PrivateData.PSData.Delivery.UpgradeText when available. If not defined,
4040
looks for an UPGRADE* file; otherwise throws.
4141
4242
.PARAMETER All
4343
Show Introduction, README, CHANGELOG and LICENSE in a standard order. You can still add
4444
specific switches (e.g., -Changelog) and they will be included additively without duplication.
4545
4646
.PARAMETER Links
47-
Print ImportantLinks defined in PrivateData.PSData.PSPublishModuleDelivery after the selected documents.
47+
Print ImportantLinks defined in PrivateData.PSData.Delivery after the selected documents.
4848
4949
.PARAMETER File
5050
Relative path to a specific file to display (relative to module root or Internals). If rooted, used as-is.
@@ -165,7 +165,7 @@ function Show-ProjectDocumentation {
165165
$manifestPath = Join-Path $rootBase ("{0}.psd1" -f $Module.Name)
166166
$delivery = $null
167167
if (Test-Path -LiteralPath $manifestPath) {
168-
try { $manifest = Test-ModuleManifest -Path $manifestPath; $delivery = $manifest.PrivateData.PSData.PSPublishModuleDelivery } catch {}
168+
try { $manifest = Test-ModuleManifest -Path $manifestPath; $delivery = $manifest.PrivateData.PSData.Delivery } catch {}
169169
}
170170
$internalsRel = if ($delivery -and $delivery.InternalsPath) { [string]$delivery.InternalsPath } else { 'Internals' }
171171
$intCandidate = Join-Path $rootBase $internalsRel
@@ -242,20 +242,20 @@ function Show-ProjectDocumentation {
242242

243243
foreach ($t in $targets) {
244244
if ($t.Kind -eq 'Intro') {
245-
if ($manifest -and $manifest.PrivateData -and $manifest.PrivateData.PSData -and $manifest.PrivateData.PSData.PSPublishModuleDelivery -and $manifest.PrivateData.PSData.PSPublishModuleDelivery.IntroText) {
245+
if ($manifest -and $manifest.PrivateData -and $manifest.PrivateData.PSData -and $manifest.PrivateData.PSData.Delivery -and $manifest.PrivateData.PSData.Delivery.IntroText) {
246246
$title = if ($moduleName) { "$moduleName $moduleVersion - Introduction" } else { 'Introduction' }
247247
Write-Heading -Text $title
248-
foreach ($line in [string[]]$manifest.PrivateData.PSData.PSPublishModuleDelivery.IntroText) { Write-Host $line }
248+
foreach ($line in [string[]]$manifest.PrivateData.PSData.Delivery.IntroText) { Write-Host $line }
249249
} else {
250250
Write-Warning 'Introduction text not defined in delivery metadata.'
251251
}
252252
continue
253253
}
254254
if ($t.Kind -eq 'Upgrade') {
255-
if ($manifest -and $manifest.PrivateData -and $manifest.PrivateData.PSData -and $manifest.PrivateData.PSData.PSPublishModuleDelivery -and $manifest.PrivateData.PSData.PSPublishModuleDelivery.UpgradeText) {
255+
if ($manifest -and $manifest.PrivateData -and $manifest.PrivateData.PSData -and $manifest.PrivateData.PSData.Delivery -and $manifest.PrivateData.PSData.Delivery.UpgradeText) {
256256
$title = if ($moduleName) { "$moduleName $moduleVersion - Upgrade" } else { 'Upgrade' }
257257
Write-Heading -Text $title
258-
foreach ($line in [string[]]$manifest.PrivateData.PSData.PSPublishModuleDelivery.UpgradeText) { Write-Host $line }
258+
foreach ($line in [string[]]$manifest.PrivateData.PSData.Delivery.UpgradeText) { Write-Host $line }
259259
} else {
260260
$f = Resolve-DocFile -Kind 'UPGRADE' -RootBase $rootBase -InternalsBase $internalsBase -PreferInternals:$PreferInternals
261261
if ($f) {
@@ -285,7 +285,7 @@ function Show-ProjectDocumentation {
285285
Write-Host
286286
}
287287
if ($Links) {
288-
$links = $manifest.PrivateData.PSData.PSPublishModuleDelivery.ImportantLinks
288+
$links = $manifest.PrivateData.PSData.Delivery.ImportantLinks
289289
if ($links) {
290290
Write-Heading -Text ((if ($moduleName) { "$moduleName $moduleVersion - Links" } else { 'Links' }))
291291
foreach ($l in $links) {

0 commit comments

Comments
 (0)