dsccommunity / AzureDevOpsDsc

This module contains DSC resources for deployment and configuration of initially Azure DevOps Services and later Azure DevOps Server.
MIT License
1 stars 5 forks source link

AzureDevOpsDsc: Enums should move out of prefix file #12

Closed johlju closed 3 years ago

johlju commented 3 years ago

Like 'Classes' enums should be single ps1 files with 1 enum definition per file. Compilation will put them in the main module psm1. No needs for subfolders in enums.

https://github.com/dsccommunity/AzureDevOpsDsc/blob/8d43d12989359b8facdf46d86011a34dfe787898/source/prefix.ps1#L13-L28

As per https://github.com/dsccommunity/AzureDevOpsDsc/pull/7#issuecomment-729941083.

SphenicPaul commented 3 years ago

@johlju / @gaelcolas - Regarding this point, having moved the enums into their own directory (and files) and out of the prefix.ps1, the enums don't end up in the final AzureDevOps.psm1 file. The classes that use/require them hit errors when the .psm1 file is run/loaded because the enums aren't present.

See fork branch here.

I'm skipping this for now but any thoughts/comments/suggestions welcome.

johlju commented 3 years ago

Well, it seems the folder name should be the very non-intuitive Enum and not Enums. One would not expect that since the other folder is Classes and not Class. 😆

I had to double-check in this repo as I know @gaelcolas made it work there: https://github.com/dsccommunity/JeaDsc/tree/master/source

I learned something new today. 🙂

gaelcolas commented 3 years ago

It's a Module Builder thing, but yeah I agree that it's not very intuitive

On Thu, 28 Jan 2021, 19:50 Johan Ljunggren, notifications@github.com wrote:

Well, it seems the folder name should be the very non-intuitive Enum and not Enums that you would expect since the other folder is Classes and not Class. 😆

I had to double-check in this repo as I know @gaelcolas https://github.com/gaelcolas made it work there: https://github.com/dsccommunity/JeaDsc/tree/master/source

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dsccommunity/AzureDevOpsDsc/issues/12#issuecomment-769297720, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACEMANPYGQ2CPNFURU6BWVDS4GWYDANCNFSM4WQP2IEQ .

SphenicPaul commented 3 years ago

Thanks both. That resolved it. 😄

Added to PR #28.