8000 Merge pull request #10 from justin-p/Tests · ModuleBuild/ModuleBuild@12eb774 · GitHub
[go: up one dir, main page]

Skip to content

Commit 12eb774

Browse files
authored
Merge pull request #10 from justin-p/Tests
2 parents 605e52b + de7d92f commit 12eb774

24 files changed

+127
-25
lines changed

build/docs/Additional/Acknowledgements.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
Project Site: [https://github.com/zloeber/ModuleBuild](https://github.com/zloeber/ModuleBuild)
44

5-
This project owes some acknowlegement to other projects. Here are some other authors or projects which have made this project possible. If you believe you or a project should be included in this list please let us know.
5+
This project owes some acknowledgements to other projects. Here are some other authors or projects which have made this project possible. If you believe you or a project should be included in this list please let us know.
66

77
[Invoke-Build](https://github.com/nightroman/Invoke-Build) - A kick ass build automation tool written in PowerShell. It is the primary engine behind this little project.
88

99
[Plaster](https://github.com/PowerShell/Plaster) - Used for the code scaffolding portion of this project.
1010

1111
[PSCodeHealth](https://github.com/MathieuBuisson/PSCodeHealth) - PowerShell code health reporting.
1212

13+
[PSDepend](https://github.com/RamblingCookieMonster/PSDepend) - PowerShell Dependency Handler.
14+
1315
[Hitchhikers Guide to the PowerShell Pipeline](https://xainey.github.io/2017/powershell-module-pipeline/)
1416

1517
[Write the Faq'n Manual](https://get-powershellblog.blogspot.com/2017/03/write-faq-n-manual-part1.html)

build/docs/Additional/ChangeLog.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,54 +2,94 @@
22

33
Project Site: [https://github.com/zloeber/ModuleBuild](https://github.com/zloeber/ModuleBuild)
44

5+
## Version 0.3.0
6+
7+
- Fixed issue with NLog by updating PlaterContent.ps1
8+
- Fixed issue with Make.ps1 By adding --tags --always
9+
- Fixed issue with Make.ps1. Write-Description -level 3 should be used instead of Write-Output
10+
- Fixed issue with Get-SpecialPaths function by adding LoadBuildTools on InstallAndTestModule
11+
- Fixed issue with -SourceModule parameter on Initialize-ModuleBuild
12+
- Fixed issue with the -AddCBH when there are no Params.
13+
- Fixed issue with URLS in README.md. It was missing links to VSCode and the PS Extension.
14+
- Fixed issue with the link to ChangeLog. ChangeLog in index.md was plural.
15+
- Fixed issue that where caused when you where not using PlatyPS 0.12.0.
16+
- Fixed issue with syntax highlight that was caused by the CommentBasedHelp function.
17+
- Update ModuleBuild to adhere to the PSGallery ScriptAnalyzer ruleset.
18+
- ModuleBuild no uses a standalone PSScriptAnalyzerSettings.psd1
19+
- Updated ModuleBuild/.vscode/settings.json to include default indent size, set indent to space and use the project specific PSScriptAnalyzerSettings.psd1 file.
20+
- Build reports are now saved on the following path `build\reports\$ModuleVersion\`.
21+
- Included functions that are used during the build process are moved to its own repository.
22+
- Included functions that are used during the build process are renamed to avoid conflicts with other modules.
23+
- ModuleBuild now uses PSDepend to manage Build dependencies.
24+
- ModuleBuild now uses PSDepend to manage Plugins.
25+
- Revamped included tests.
26+
- Make.ps1 is no longer dotsourced but included in `MakePlasterManifest.ps1`
27+
- Updated the build scripts to better support CI/CD.
28+
- The included version of Plater is moved to the Plugin folder.
29+
- Added a AppVeyor.yml template to the scaffold.
30+
- Cleaned up repo. Deleted unused code. Renamed/Moved existing files.
31+
- Updated documentation to reflect above changes.
32+
533
## Version 0.2.3
34+
635
- Added ability to pull in some basic information about an existing module manifest files when running initialize-modulebuild.
736
- Fixed ReadTheDocs generation issues by updating the template to include build\docs\ReadTheDocs in the initialization process.
837
- Eliminated any customization requirements within the modulename.build.ps1 script to help pave the way for easier modulebuild upgrades to projects.
938
- Removed some superfluous code in the base build environment script around the RequiredModules variable.
39+
1040
## Version 0.2.2
41+
1142
- Updated vscode tasks.json to fix depreciated syntax.
1243
- Fixed `-Force` switch processing on Add-PublicFunction to still create the function if the F438 provided name is detected as plural.
1344
- Fixed [cleanup script modulebuild execution issue](https://github.com/zloeber/ModuleBuild/issues/5) by separating out the postbuildtask into its own Invoke-Build code block (I had done this a while ago and never rolled up the changes into the Plaster template).
1445
- Fixed a glaring issue with the PlatyPS output where any Guids were 00000000-0000-0000-0000-000000000000 instead of the actual module manifest Guid [reported via issue #6](https://github.com/zloeber/ModuleBuild/issues/6). This happens because we build the module help from the psm1 load of the module in memory, not the psd1 file as that psd1 manifest gets recreated at build time with the appropriate exported functions and such. Basically a chicken/egg scenario. For now we just manually replace the output markdown files with the correct Guid before moving on to the help file packaging.
1546

1647
## Version 0.2.1
48+
1749
- Merged pull request #3 to resolve initialization issues for new modules in directories with spaces in their path.
1850
- Added additional github integration (via .github folder creation with pull and issue template markdown files)
1951
- Fixed improper spelling of 'license' in license creation templating.
2052

2153
## Version 0.1.10
54+
2255
- Fixed the -AddCBH build task.
2356
- Fixed the missing documentation platyps output to show the actual found line that indicates missing CBH.
2457

2558
## Version 0.1.9
59+
2660
- Removed plaster option to choose to combine the module source at build time (and simply made that behavior the default that can be changed later via Set-MBTBuildEnvironment -OptionCombineFiles $false)
2761
- Added option to run a code health report (via PSCodeHealth) against your public and private function directories prior to starting the build
2862
- Added 'Module plugin' capability. This adds base functionality to the module project itself. The first included module plugin is the nlogmodule logging functionality.
2963

3064
## Version 0.1.6
65+
3166
- Added New-PublicFunction to module along with a template folder and basic function template to start with. Any src\templates\\\<template_name\>.tem file is able to be used for this new feature and any build environment variable surrounded by double percentage symbols will be automatically replaced (ie. %%ModuleName%%).
3267
- Fixed ReadTheDocs yml creation issue with the licensing link.
3368

3469
## Version 0.1.5
70+
3571
- Fixed awful .gitignore settings included in the default scaffolding
3672
- Fixed documentation links to be self-referencing
3773
- Removed AdditionalModulePaths from initial plaster manifest (can just set this with Set-MBTBuildEnvironment after creation)
3874

3975
## Version 0.1.4
76+
4077
- Fixed invalid mkdocs.yml license link reference
4178
- Fixed invalid reference to acknowledgements folder in plaster manifest (thanks Roberto Desideri!)
4279

4380
## Version 0.1.3
81+
4482
- Fixes to mkdocs.yml formatting
4583
- Fixed temp build directory exclusion in .gitignore file
4684

4785
## Version 0.1.2
86+
4887
- Updated vs code task names
4988
- Fixed an issue with a null build environment variable causing dynamic parameters in Set-MBTBuildEnvironment to fail
5089
- Several small scaffolding clean ups.
5190

5291
## Version 0.1.1
92+
5393
- Removed prompts for the nuget api key when running initialize-modulebuild.
5494
- Initialize-ModuleBuild now automatically runs the build environment powershell script for the first time to create the modulebuild json settings file.
5595
- More documentation.
@@ -62,19 +102,23 @@ Project Site: [https://github.com/zloeber/ModuleBuild](https://github.com/zloebe
62102
- Fixed initial sensitive term settings generation to work on non-domain joined machines.
63103

64104
## Version 0.0.6
105+
65106
- Changed all template files from .ps1 or psm1 to .template and changed the plaster manifest accordingly
66107
- Change all .<filename> files to remove the period so uploads to the gallery will work properly
67108
- Combined the UpdateRelease and NewVersion tasks and made both promptable
68109
- Fixed git version tag issue with the build script for the plaster manifest file.
69110
- Removed options to prompt for different folder names (like public/private/other/temp) and updated all template files and plaster manifest file accordinly.
70111

71112
## Version 0.0.5
113+
72114
- fixes to plaster template creation
73115

74116
## Version 0.0.4
117+
75118
- fixes to psgallery upload
76119

77120
## Version 0.0.3
121+
78122
- Eliminated all '-Before' and '-After' in task definitions
79123
- Added 'Write-Description' helper function and converted all write-build lines to use it instead (for a quick indented output that is easier on the eyes)
80124
- Eliminated a large number of global variables in favor of simply redefining them in local tasks when required
@@ -86,7 +130,9 @@ Project Site: [https://github.com/zloeber/ModuleBuild](https://github.com/zloebe
86130
- Updated much of the documentation.
87131

88132
## Version 0.0.2
133+
89134
- Structural changes
90135

91136
## Version 0.0.1
137+
92138
- Initial release

build/docs/Additional/Contributing.md

Lines changed: 7 additions & 5 deletions
< EED3 tr class="diff-line-row">
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@ Project Site: [https://github.com/zloeber/ModuleBuild](https://github.com/zloebe
55
There are some important things to be aware of if you plan on contributing to this project.
66

77
## Documentation
8+
89
All base project documentation changes should be made against the .\build\docs\Additional markdown files. These will populate and overwrite existing document files within the .\docs folder at build time. Additionally, you should update the .\build\docs\ReadTheDocs markdown files. Note that each folder becomes its own section within ReadTheDocs and its own folder within the .\docs directory.
910

1011
Finally, the Function documentation gets generated automatically based on the comment based help on each public/exported function. The function documentation markdown automatically gets populated within the .\docs\Functions folder as well as with the module release under its own docs folder. Private function CBH is not required but is encouraged.
1112

1213
## Development Environment
13-
While any text editor will work well there are included task and setting json files explicitly for Visual Studio Code included with this project. I used VS Code Insiders edition but standard edition should be fine as well. The following tasks have been defined to make things a bit easier. First access the 'Pallette' (Shift+Ctrl+P or Shift+Cmd+P) and start typing in any of the following tasks to find and run them:
1414

15-
- Build -> Runs the Build task (also can use Shift+Ctrl+B or Shift+Cmd+B)
16-
- Analyze -> Runs PSScriptAnalyzer against the src/public files.
17-
- CreateProjectHelp - Creates the project level help.
18-
- AddMissingCBH - Analyzes the existing public functions and inserts a template CBH if no CBH already exists and saves it into your scratch folder.
15+
While any text editor will work well there are included task and setting json files explicitly for Visual Studio Code included with this project. I used VS Code Insiders edition but standard edition should be fine as well. The following tasks have been defined to make things a bit easier. Open the 'configured tasks'-menu (use Shift+Ctrl+B or Shift+Cmd+B) and start typing in any of the following tasks to find and run them:
16+
17+
- Build Module -> Runs the Build task
18+
- Insert Missing COmment Based Help -> Analyzes the existing public functions and inserts a template CBH if no CBH already exists and saves it into your scratch folder.
19+
- Run Tests -> Run Pester tests
20+
- Test, Build, Install and Load Module -> Run the Test, build tasks but also install and try to load the module.
1921

2022
The plaster manifest file gets automatically recreated at build time so all you need to do is update the plasterparams.ps1 and/or plastercontent.ps1 in the plaster directory to include any required changes you need to make.
2123

build/docs/Additional/ToDo.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ There are many items which are possible and should probably be added to this pro
1313
- Automatic clean up of additional loaded modules when uploading to the gallery
1414
- Powershell Core compatibility
1515
- Automatic updates of the ReleaseNotes.md file
16-
- Appveyor integration?
1716
- PSDeploy integration?
1817
- Github releases integration?
1918
- Smoother path to upgrade ModuleBuild for existing projects

build/docs/ReadTheDocs/Usage/3 - Build A Release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ or
1010

1111
or in VS Code
1212

13-
Press 'Ctrl+Shift+B' then select 'Build'
13+
Press 'Ctrl+Shift+B' then select `Build Module`
1414

1515
This is the heart of the ModuleBuild project. The build will go through the process of combining the source files into a monolithic psm1 file, populating the exportable functions of the release module manifest, creating online help files, analyze the script, scan for sensitive terms, and more. If everything builds without errors you will see the results populated in the release directory in two areas:
1616

build/docs/ReadTheDocs/Usage/4 - Test A Release.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ If the module path already exists, the build script will ask for confirmation be
1111

1212
You can combine the build with the install and test of the module if you so desire:
1313

14-
`.\Build.ps1 -BuildModule -InstallAndTestModule`
14+
`.\Build.ps1 -TestBuildAndInstallModule`
1515

1616
or
1717

1818
`Invoke-Build -Task BuildInstallAndTestModule`
1919

2020
or in VS Code
2121

22-
`Ctrl+Shift+B (then select "Build, Install, and Load Module")`
22+
`Ctrl+Shift+B (then select "Test, Build, Install, and Load Module")`

build/docs/ReadTheDocs/Usage/9 - ModuleBuild Configuration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ You can add items directly to this file if you like and they will be loaded and
1111
## Configuration Process
1212

1313
Whenever you kick off a process involving any of your build steps the ModuleName.buildenvironment.ps1 file is dot sourced into the session. When this file is invoked a few things happen:
14+
1415
1. The default settings that are populated from initializing the project scaffolding are assigned to the global build environment variable that is aptly called 'BuildEnv'.
1516
2. We then look for ModuleName.buildenvironment.json. If it exists, we load and use any settings within the file over any of the default values previously defined in the buildenvironment.ps1 file.
1617
3. We then optionally update the json config file if any of the following conditions are met:
@@ -36,6 +37,7 @@ Use this against an existing module directory to load the module into memory to
3637
## Add-PublicFunction
3738

3839
This function will parse your build environment config file for the location of your function templates directory (default = src\templates) and allow you to use one of them to create a new public function for your module. Some basic validation of the function name will be done including:
40+
3941
- Verb-Noun format
4042
- Noun is singular, not plural
4143
- Function doesn't already exist

build/reports/0.3.0/CodeHealthReport-Private.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ <h1>
189189
<div class="col-sm-4 col-md-5 col-lg-4 right-header">
190190
<h5>
191191
Analyzed path :<span class="right-header-data"> src\private</span><br>
192-
Analysis date :<span class="right-header-data"> 2020-04-23 21:15:21Z</span>
192+
Analysis date :<span class="right-header-data"> 2020-04-23 22:23:41Z</span>
193193
</h5>
194194
</div>
195195
</div>

build/reports/0.3.0/CodeHealthReport-Public.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ <h1>
189189
<div class="col-sm-4 col-md-5 col-lg-4 right-header">
190190
<h5>
191191
Analyzed path :<span class="right-header-data"> src\public</span><br>
192-
Analysis date :<span class="right-header-data"> 2020-04-23 21:13:41Z</span>
192+
Analysis date :<span class="right-header-data"> 2020-04-23 22:22:02Z</span>
193193
</h5>
194194
</div>
195195
</div>

docs/Acknowledgements.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,16 @@
22

33
Project Site: [https://github.com/zloeber/ModuleBuild](https://github.com/zloeber/ModuleBuild)
44

5-
This project owes some acknowlegement to other projects. Here are some other authors or projects which have made this project possible. If you believe you or a project should be included in this list please let us know.
5+
This project owes some acknowledgements to other projects. Here are some other authors or projects which have made this project possible. If you believe you or a project should be included in this list please let us know.
66

77
[Invoke-Build](https://github.com/nightroman/Invoke-Build) - A kick ass build automation tool written in PowerShell. It is the primary engine behind this little project.
88

99
[Plaster](https://github.com/PowerShell/Plaster) - Used for the code scaffolding portion of this project.
1010

1111
[PSCodeHealth](https://github.com/MathieuBuisson/PSCodeHealth) - PowerShell code health reporting.
1212

13+
[PSDepend](https://github.com/RamblingCookieMonster/PSDepend) - PowerShell Dependency Handler.
14+
1315
[Hitchhikers Guide to the PowerShell Pipeline](https://xainey.github.io/2017/powershell-module-pipeline/)
1416

1517
[Write the Faq'n Manual](https://get-powershellblog.blogspot.com/2017/03/write-faq-n-manual-part1.html)

0 commit comments

Comments
 (0)
0