Open iRon7 opened 7 months ago
I think you looking for ModuleBuilder or create a new module project using Sampler's Plaster templates (which will build a module using ModuleBuilder).
@johlju,
What I understand from the ModuleBuilder is that is pushes the author to setup a module according to certain guidelines (that only slightly differ from my own) and prepares the module for publishing. But issues #18, #35 and the line:
Let's me believe that it won't resolve the issue of handling interdependent classes during the design (development and testing) phase...
Nothing can help resolve that, unless an editor can parse and understand the AST (which I know none that can). For a class to be known during development (assuming the goal is intellisense) it needs to be loaded into the session, and a class that is loaded into a session cannot be changed unless starting a new session.
During testing you should build the module, then load the entire module in to a session, then run tests on the built module. 🤔
Background:
From my project, I have created a few PowerShell classes currently contained by a single file. As the project is growing (the number and size of the classes), I would like to separate my classes over multiple files. The problem with doing so is that the classes are interdependent. see: Is it possible to declare two interdependent classes each in a separate file?
mcve setup:
.\Source\Classes\a.ps1
.\Source\Classes\b.ps1
module.psm1
file in the root containing:The issue(s) with this are in fact shown by VSCode (the PSScriptAnalyzer)
In the comment of the related StackOverflow question @TheMadTechnician, suggests that maybe this is something PSDepend could help.
If that is correct, can you show (or refer to) an example based on this mcve?