Skip to content

Commit

Permalink
Merge pull request #7 from webmd-health-services/feature/reduce-nesting
Browse files Browse the repository at this point in the history
Reduce directory nesting of modules
  • Loading branch information
splatteredbits authored Dec 4, 2024
2 parents 5afa3ec + 790e88e commit 4bf0bc5
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 45 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

# Carbon.Registry Changelog

## 1.2.1

Reducing directory depth of internal, private, nested modules.

## 1.2.0

> Unreleased
> Released 10 Jun 2024
Added `Get-CRegistryPermission`, `Grant-CRegistryPermission`, `Revoke-CRegistryPermission`, and
`Test-CRegistryPermission`, migrated from Carbon's `Get-CPermission`, `Grant-CPermission`, `Revoke-CPermission`, and
Expand All @@ -16,6 +20,7 @@ Added `Get-CRegistryPermission`, `Grant-CRegistryPermission`, `Revoke-CRegistryP
* Replace usages of the `Test-CRegistryPermission` function's `-Exact` switch to `-Strict`.
* Using the table below, replace usages of `Grant-CRegistryPermission` and `Test-CRegistryPermission` arguments in the
left column with the new arguments from the right column.

| Old Argument | New Argument(s)
|---------------------------------------------------------|---------------------------------------------------------
| `-Permission Container` | `-Permission KeyOnly`
Expand Down
2 changes: 1 addition & 1 deletion Carbon.Registry/Carbon.Registry.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
RootModule = 'Carbon.Registry.psm1'

# Version number of this module.
ModuleVersion = '1.2.0'
ModuleVersion = '1.2.1'

# ID used to uniquely identify this module
GUID = '9772fb52-add8-47bf-83dc-0294ca8d9c64'
Expand Down
6 changes: 2 additions & 4 deletions Carbon.Registry/prism.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
"PSModules": [
{
"Name": "Carbon.Security",
"Version": "1.*-*"
"Version": "1.*"
}
],

"PSModulesDirectoryName": "Modules"
]
}
2 changes: 1 addition & 1 deletion Carbon.Registry/prism.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"PSModules": [
{
"name": "Carbon.Security",
"version": "1.0.0-rc6",
"version": "1.0.3",
"repositorySourceLocation": "https://www.powershellgallery.com/api/v2"
}
]
Expand Down
6 changes: 5 additions & 1 deletion Tests/Grant-CRegistryPermission.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ BeforeAll {

& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-Test.ps1' -Resolve)

Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\PSModules\Carbon.Accounts' -Resolve) `
-Function @('Resolve-CPrincipalName') `
-Verbose:$false

$script:testKeyPath = $null
$script:testNum = 0

Expand Down Expand Up @@ -123,7 +127,7 @@ BeforeAll {
@optionalParams
$result = $result | Select-Object -Last 1
$result | Should -Not -BeNullOrEmpty
$result.IdentityReference | Should -Be (Resolve-CIdentityName $Identity)
$result.IdentityReference | Should -Be (Resolve-CPrincipalName $Identity)
$result | Should -BeOfType $expectedRuleType
if( -not $ExpectedPermission )
{
Expand Down
3 changes: 0 additions & 3 deletions Tests/Initialize-Test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,3 @@ finally
$Global:VerbosePreference = $originalVerbosePref
$Global:WhatIfPreference = $originalWhatIfPref
}

Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\PSModules\Carbon.Accounts' -Resolve) `
-Function @('Resolve-CIdentityName')
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Set-StrictMode -Version Latest

# Set to a specific version to use a specific version of Whiskey.
$whiskeyVersion = '0.*'
$allowPrerelease = $false
$allowPrerelease = $true

$psModulesRoot = Join-Path -Path $PSScriptRoot -ChildPath 'PSModules'
$whiskeyModuleRoot = Join-Path -Path $PSScriptRoot -ChildPath 'PSModules\Whiskey'
Expand Down
2 changes: 0 additions & 2 deletions init.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ Set-StrictMode -Version 'Latest'
$ErrorActionPreference = 'Stop'
$InformationPreference = 'Continue'

prism install | Format-Table

Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath 'PSModules\Carbon' -Resolve) `
-Function @('Install-CGroup', 'Install-CUser')

Expand Down
2 changes: 1 addition & 1 deletion prism.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
{
"Name": "Carbon.Accounts",
"Version": "1.*-*"
"Version": "2.*"
}
]
}
2 changes: 1 addition & 1 deletion prism.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
{
"name": "Carbon.Accounts",
"version": "1.0.0-rc3",
"version": "2.0.2",
"repositorySourceLocation": "https://www.powershellgallery.com/api/v2"
}
]
Expand Down
46 changes: 17 additions & 29 deletions whiskey.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,28 @@ Build:
- "*": rc1
IncrementPrereleaseVersion: true

- PowerShell:
WorkingDirectory: Carbon.Registry
ExceptDuring: Clean
ScriptBlock: prism install | Format-Table -Auto
# Update the AppVeyor build/version number.
- Exec: appveyor UpdateBuild -Version "$(WHISKEY_SEMVER2)+$(WHISKEY_BUILD_NUMBER)"
.OnlyBy: BuildServer

- PowerShell:
ExceptDuring: Clean
Path: init.ps1
ScriptBlock: |
prism install | Format-Table -Auto
prism install -Path .\Carbon.Registry | Format-Table -Auto
.ExceptDuring: Clean

- PowerShell:
OnlyDuring: Clean
Path: reset.ps1
- PowerShell: .\init.ps1
.ExceptDuring: Clean

# Update the AppVeyor build/version number.
- Exec:
OnlyBy: BuildServer
Path: appveyor
Argument: [ UpdateBuild, -Version, "$(WHISKEY_SEMVER2)+$(WHISKEY_BUILD_NUMBER)" ]
- PowerShell: .\reset.ps1
.OnlyDuring: Clean

# Dot-sourcing files is expensive. Move all functions into .psm1 file to improve import speed. Do this before testing
# to ensure the module still works.
- MergeFile:
OnlyBy: BuildServer
.OnlyBy: BuildServer
# Builds run twice on some serves. Only run this step if the module hasn't been merged yet.
IfExists: Carbon.Registry\Functions\*.ps1
.IfExists: Carbon.Registry\Functions\*.ps1
Path:
- Carbon.Registry\Functions\*.ps1
DestinationPath: Carbon.Registry\Carbon.Registry.psm1
Expand All @@ -54,10 +51,8 @@ Build:
- "*.pdb"
- "*.orig"

- Exec:
OnlyBy: BuildServer
Path: appveyor
Argument: [ 'PushArtifact', '.output/Carbon.Registry-$(WHISKEY_SEMVER2).zip', '-DeploymentName', 'GitHub' ]
- Exec: appveyor 'PushArtifact' '.output/Carbon.Registry-$(WHISKEY_SEMVER2).zip' -DeploymentName 'GitHub'
.OnlyBy: BuildServer

- Pester:
Configuration:
Expand All @@ -75,12 +70,5 @@ Build:
- PublishPowerShellModule:
Path: Carbon.Registry

- Exec:
OnlyBy: BuildServer
Path: appveyor
Argument: [
'PushArtifact',
'.output/Carbon.Registry.$(WHISKEY_SEMVER2_NO_BUILD_METADATA).nupkg',
'-DeploymentName',
'PowerShellGallery'
]
- Exec: appveyor 'PushArtifact' '.output/Carbon.Registry.$(WHISKEY_SEMVER2_NO_BUILD_METADATA).nupkg' -DeploymentName 'PowerShellGallery'
.OnlyBy: BuildServer

0 comments on commit 4bf0bc5

Please sign in to comment.