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

Add functionality for automating the substitution of public functions into the manifest #98

Open
techthoughts2 opened this issue Oct 5, 2024 · 2 comments
Assignees
Labels
discussion Community input on issuedesired enhancement New feature or request

Comments

@techthoughts2
Copy link
Owner

It has been suggested in both #69 and #97 that Catesta should automate the process of populating public functions into the .psd1 manifest.

One proposed solution is to add a build task for this:

#Updates the array for FunctionsToExport in the module manifest
Add-BuildTask UpdateFunctionsToExport -Before TestModuleManifest {
    Write-Build White '      Running module manifest update FuctionsToExport...'
    $publicFunctionPath = Join-Path -Path $script:ModuleSourcePath -ChildPath 'Public'
    $publicFunctions = Get-ChildItem -Path $publicFunctionPath -Filter '*.ps1' -Recurse
    Update-ModuleManifest -Path $script:ModuleManifestFile -FunctionsToExport $publicFunctions.BaseName
    Write-Build Green '      ...Module Manifest Update FunctionsToExport Complete!'
} #UpdateFunctionsToExport

I'd like some community feedback on this change. Are there situations where this would not be desirable?

@techthoughts2 techthoughts2 added enhancement New feature or request discussion Community input on issuedesired labels Oct 5, 2024
@SamErde
Copy link
Contributor

SamErde commented Oct 5, 2024

I like the idea of doing a check. If both are empty or a wildcard, then the task can add all found public functions or cmdlets. If a value is there already, leave it unchanged [unless an -AddFunctions or -ExportAll switch is used with the build script].

@SQLCanuck
Copy link

Personally, I feel some sort of automation for the FunctionsToExport is necessary. Be it by the above proposed solution or some variant. As the purpose of having the Public directory, is to easily automate what functions are included during a build process.

@techthoughts2 techthoughts2 changed the title Add functionality to automating the substitution of public functions into the manifest Add functionality for automating the substitution of public functions into the manifest Oct 11, 2024
@techthoughts2 techthoughts2 self-assigned this Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Community input on issuedesired enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants