Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix class resource generation #163

Merged
merged 45 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
235cb4a
Move doc generation to own pipeline task
Oct 25, 2024
145469c
Fix DscClass Doc Generation
Oct 25, 2024
4b57710
Remove unused files
Oct 25, 2024
d3e3dbb
Update changelog
Oct 25, 2024
e480d0f
Fix HQRM
Oct 28, 2024
6d0cadb
Update help
Nov 6, 2024
d194522
Remove unused function
Nov 6, 2024
95c1c69
Remove blank lines and fix build warning message
Nov 6, 2024
880548e
Remove commented code
Nov 6, 2024
9082c86
Update expected parameter order
Nov 6, 2024
9b0fc57
Update parameter order
Nov 6, 2024
6128744
Add comment based help
Nov 6, 2024
eb7579c
Add new helper function
Nov 6, 2024
7c74acb
Fix additional indentation
Nov 6, 2024
d199d20
Add comment based help and use fullname
Nov 6, 2024
e84bbe7
Update expected parameter order
Nov 6, 2024
df1d9d7
Use correct docs tasks
Nov 6, 2024
6583d38
Update comment based help and remove code comments
Nov 6, 2024
fe4a522
Add empty test files
Nov 6, 2024
faaac4b
Update type to a full type name
Nov 7, 2024
207fdd0
Re-import module every time
Nov 7, 2024
25c42f8
Add Tests
Nov 7, 2024
72cdebe
Update tests
Nov 7, 2024
f331829
Remove debug warning
Nov 7, 2024
260b642
Fix DscClass Doc Generation
Oct 25, 2024
e52cc0b
Remove unused function
Nov 6, 2024
436dc7a
Remove blank lines and fix build warning message
Nov 6, 2024
f2962fa
Add new helper function
Nov 6, 2024
7897971
Use correct docs tasks
Nov 6, 2024
1d4e5ae
Remove debug warning
Nov 7, 2024
c01999f
Increase coverage
Nov 7, 2024
a0ab9c1
Add tests
Nov 7, 2024
d7fc8fb
Add tests
Nov 7, 2024
61a9356
Update tests
Nov 7, 2024
d36ab99
Update example
Nov 7, 2024
e1006e7
Update tests
Nov 7, 2024
17c5160
Update Changelog
Nov 7, 2024
dce4916
Fix merge failure
Nov 7, 2024
192445a
Remove comment
Nov 7, 2024
1144d26
Undo config change
Nov 7, 2024
ec32d71
Re-add all docs tasks
dan-hughes Nov 17, 2024
b56de0f
Remove config warning, remove tasks run by Generate_Wiki_Content
dan-hughes Nov 17, 2024
fb5aa9f
Rename Get-ClassResourcePropertyState2 to Get-ClassResourcePropertyType
dan-hughes Nov 17, 2024
ce3e15f
Match filename to function name
dan-hughes Nov 17, 2024
22101f6
Rename function again
dan-hughes Nov 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Removed

- Removed `build.psd1` as it is no longer required to build the project.
- Removed ClassAst functions
- `Get-ClassResourceProperty`
- `Get-ClassAst`
- `Get-ClassResourceAst`

### Added

Expand All @@ -25,6 +29,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
filename. The task will convert standard hyphens to spaces and Unicode
hyphens to standard hyphens before comparison. The task can be controlled
by parameter `RemoveTopLevelHeader` in the task, which defaults to `$true`.
- Added Helper functions as part of [#163] (https://github.com/dsccommunity/DscResource.DocGenerator/pull/163).
- `Get-ClassPropertyCustomAttribute`
- `Get-DscResourceAttributeProperty`
- `Get-DscPropertyType`
- `Test-ClassPropertyDscAttributeArgument`

### Changed

Expand All @@ -42,6 +51,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Task `Generate_Markdown_For_DSC_Resources`
- Outputs a warning message if the old configuration key is used in the
build configuration but keeps using the old configuration key.
- `New-DscClassResourcePage`
- Remove using Ast to generate documentation. Fixes [#116](https://github.com/dsccommunity/DscResource.DocGenerator/issues/116).
- Order properties correctly fixes [#126](https://github.com/dsccommunity/DscResource.DocGenerator/issues/126).

### Fixed

Expand Down
25 changes: 12 additions & 13 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ Prefix: ./prefix.ps1
####################################################

NestedModule:
DscResource.Common:
CopyOnly: true
Path: ./output/RequiredModules/DscResource.Common
AddToManifest: false
Exclude: PSGetModuleInfo.xml
DscResource.Common:
CopyOnly: true
Path: ./output/RequiredModules/DscResource.Common
AddToManifest: false
Exclude: PSGetModuleInfo.xml

####################################################
# Sampler Pipeline Configuration #
Expand All @@ -35,16 +35,17 @@ BuildWorkflow:
- Build_Module_ModuleBuilder
- Build_NestedModules_ModuleBuilder
- Create_changelog_release_output

docs:
- Generate_Conceptual_Help
- Generate_Wiki_Content
- Generate_Markdown_For_Public_Commands
- Generate_External_Help_File_For_Public_Commands
- Generate_Wiki_Sidebar
- Clean_Markdown_Of_Public_Commands
- Clean_Markdown_Metadata
- Package_Wiki_Content

pack:
- build
- docs
- package_module_nupkg

hqrmtest:
Expand All @@ -68,8 +69,6 @@ BuildWorkflow:
Remove-Module -Name 'DscResource.DocGenerator' -ErrorAction SilentlyContinue
}



####################################################
# PESTER Configuration #
####################################################
Expand Down Expand Up @@ -138,7 +137,7 @@ DscResource.DocGenerator:
- '\*(.+?)\*' # Match Italic (asterisk)
Publish_GitHub_Wiki_Content:
Debug: true
Generate_Wiki_Content:
Generate_Markdown_For_DSC_Resources:
MofResourceMetadata:
Type: MofResource
Category: Resources
Expand All @@ -149,5 +148,5 @@ DscResource.DocGenerator:
Type: CompositeResource
Category: Resources
Generate_Wiki_Sidebar:
Debug: false
AlwaysOverwrite: true
Debug: false
AlwaysOverwrite: true
69 changes: 0 additions & 69 deletions source/Private/Get-ClassAst.ps1

This file was deleted.

39 changes: 39 additions & 0 deletions source/Private/Get-ClassPropertyCustomAttribute.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<#
.SYNOPSIS
This function returns a filtered list of CustomAttributes from a given AttributeType.

.DESCRIPTION
The function will filter the provided CustomAttributes provided and returns only the matching attributes or null.

.PARAMETER Attributes
The array of attributes that need to be filtered.

.PARAMETER AttributeType
The attribute type name to filter the attributes on.

.OUTPUTS
System.Reflection.CustomAttributeData[]

.EXAMPLE
Get-ClassPropertyCustomAttribute -Attributes $CommonAttributes -AttributeType 'ValidateSetAttribute'
#>

function Get-ClassPropertyCustomAttribute
{
[CmdletBinding()]
[OutputType([System.Reflection.CustomAttributeData[]])]
param (
[Parameter(Mandatory = $true)]
[System.Reflection.CustomAttributeData[]]
$Attributes,

[Parameter(Mandatory = $true)]
[System.String]
$AttributeType
)

process
{
return $Attributes | Where-Object { $_.AttributeType.Name -eq $AttributeType }
}
}
65 changes: 0 additions & 65 deletions source/Private/Get-ClassResourceAst.ps1

This file was deleted.

Loading
Loading