Skip to content

Commit ece10f3

Browse files
Clarify helper functions must be separate private functions (#72)
## Summary - add an explicit module standard that helper logic must not be defined as nested/internal helper functions - require helper logic to be implemented as separate private function files under src/functions/private/<Group>/ ## Why This keeps function structure consistent with the one-function-per-file model and makes helpers reusable and testable. --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent ee750b5 commit ece10f3

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/docs/Modules/Standards.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Layout rules:
4242
- **One declaration per file.** Filename matches the declared symbol exactly, including casing.
4343
- **Group by domain.** Use resource or behaviour groups — not verb folders, not endpoint paths.
4444
- **Mirror public and private domains.** Public command under `src/functions/public/Projects/` has related private helpers under `src/functions/private/Projects/`.
45+
- **No nested functions.** Do not define helper functions inside other functions. Extract helper logic to a separate function file and decide whether it belongs in `src/functions/private/<Group>/` (internal-only) or `src/functions/public/<Group>/` (part of the module API).
4546
- **Declare dependencies where they are used.** Use `#Requires -Modules <Name>` at the top of each function file that needs an external module. Do not add `RequiredModules` to `src/manifest.psd1` — the build collects all `#Requires` declarations automatically and writes them into the compiled manifest. Entries in `src/manifest.psd1` are silently ignored for this purpose.
4647
- **Group documentation pages with source.** Place a `<Group>.md` file alongside the function files in each `src/functions/public/<Group>/` folder to provide a category overview in generated documentation.
4748

0 commit comments

Comments
 (0)