Skip to content

Add template-level CHANGELOG.md (CalVer)#15

Merged
tablackburn merged 10 commits into
mainfrom
chore/template-changelog
Apr 30, 2026
Merged

Add template-level CHANGELOG.md (CalVer)#15
tablackburn merged 10 commits into
mainfrom
chore/template-changelog

Conversation

@tablackburn
Copy link
Copy Markdown
Owner

@tablackburn tablackburn commented Apr 29, 2026

Summary

Adds a template-level changelog so changes to this PowerShell module template (init script, tests, scaffolding) have a tracked place to land — separate from the downstream-module starter changelog that ships to initialized modules.

  • Rename existing CHANGELOG.mdCHANGELOG.template.md (downstream-module starter; unchanged content, parallel to the existing README.template.md pattern).
  • New CHANGELOG.md — the template's own history. Uses Calendar Versioning (YYYY.MM.DD) since the template has no API contract for SemVer. First entry [2026.04.29] captures the contents of chore/template-sync (PR Template polish: SemVer manifest tests, init refactor, analyzer config, README split #14).
  • Initialize-Template.ps1 — adds a Move-Item CHANGELOG.template.md → CHANGELOG.md -Force swap (parallel to the existing README swap), plus excludes CHANGELOG.md from the placeholder substitution loop so the template's history references aren't munged.
  • tests/Manifest.tests.ps1 — adds -Skip:$isTemplate to the "Changelog and manifest versions are the same" assertion. Marker = Test-Path CHANGELOG.template.md, which only exists pre-init (init moves it to CHANGELOG.md). The marker survives init's substitution loop because no token in the path matches a {{Placeholder}}.
  • README.md (template-facing) — adds a ## Changelog section linking to CHANGELOG.md.

Why CalVer

Templates don't have an API surface that SemVer's contract maps to (cookiecutter-django's maintainer reached the same conclusion). CalVer cleanly answers the question downstream consumers actually ask — "how stale is my init?" — without requiring major/minor/patch judgment calls. Same pattern as cookiecutter-django (2026.04.24), Black, certifi.

Note on base branch

This branch is based on chore/template-sync (PR #14) because the [2026.04.29] entry documents PR #14's contents. Until PR #14 merges, the squashed diff against main will include PR #14's commits and look noisy — review the three commits on this branch individually instead. After PR #14 merges, the diff will auto-clean to only the changelog work.

Test plan

  • Marker check on un-initialized template: $isTemplate = True (CHANGELOG.template.md exists at repo root).
  • Init smoke test on a scratch copy: Move-Item CHANGELOG.template.md → CHANGELOG.md succeeds; downstream CHANGELOG.md contains substituted starter ([0.1.0] - 2026-04-29, Get-StExample); no template-only content (CalVer, 2026.04.29, Calendar Versioning) leaks into the downstream changelog.
  • Pester on initialized smoke-test module: 30 passed, 0 failed, 2 skipped (the 2 skipped are the pre-existing Describe 'Git tagging' -Skip block, unrelated). The "Changelog and manifest versions are the same" test ran un-skipped post-init, comparing 0.1.0 against 0.1.0.
  • Reviewer to confirm CI passes.

🤖 Generated with Claude Code

tablackburn and others added 9 commits April 29, 2026 16:03
…ception

- tests/Help.tests.ps1: rename undefined $parameterNames to $commandParameterNames
  in the help-vs-code parameter existence check. The variable was never assigned
  in scope, silently making the assertion always evaluate against $null.
- {{ModuleName}}/{{ModuleName}}.psm1: re-throw original exception object in the
  dot-source catch block instead of throwing a new string, preserving stack
  traces and inner-exception details for debugging.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace the single-shape Manifest.tests.ps1 dependency check with constraint-
specific assertions and a SemVer comparison helper module.

- tests/ManifestHelpers.psm1: new module exporting Test-VersionConstraint, with
  SemVer 2.0.0 prerelease ordering, .NET Version normalization, and Equal /
  GreaterOrEqual / LessOrEqual constraint modes.
- tests/Manifest.tests.ps1: differentiate ModuleVersion (minimum), RequiredVersion
  (exact), and MaximumVersion (maximum) checks; accept both string and hashtable
  shapes for entries in requirements.psd1; detect duplicate RequiredModules
  entries; skip with a reason for plain-string dependencies. Preserves the
  existing BHBuildOutput override that points at Output/<Module>/<Version>/.

Validated end-to-end against an initialized SmokeTest module: 30 passed,
0 failed, 2 -Skip'd.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- .gitattributes: mark docs/en-US/* as linguist-generated so platyPS-generated
  help files don't skew GitHub language stats.
- .markdownlint-cli2.jsonc: relax MD013 in tables and code blocks, allow MD024
  duplicate headings under different parents, and ignore AGENTS.md, the
  generated docs/en-US/**, and the instructions/** AI-agent guides.
- docs/en-US/about_{{ModuleName}}.help.md: stub for Get-Help about_<Module>.
  Initialize-Template.ps1 already renames {{ModuleName}} files in docs/en-US.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- PSScriptAnalyzerSettings.psd1: replace the single-line @{ IncludeRules = @('*') }
  with the standard structured form (IncludeDefaultRules + Include/Exclude/Rules
  blocks). Includes a commented-out PSUseCompatibleSyntax/PSUseCompatibleCmdlets
  scaffold for projects that want cross-version compatibility checks.
- build.depend.psd1: bump PSScriptAnalyzer from 1.24.0 to 1.25.0 to pick up
  newer rule fixes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The repo's README.md was a placeholder-laden module README, which made it look
like docs for a hypothetical {{ModuleName}} when viewed on GitHub. Split into
two files so the GitHub template page sells the template itself.

- README.md: rewritten as template documentation — what's included (build,
  CI, devcontainer, instructions, test infra), quick-start with Initialize-
  Template.ps1, placeholder reference table, and post-init project structure.
- README.template.md: holds the original placeholder-based module README. The
  file-processing loop in Initialize-Template.ps1 still substitutes its
  placeholders, then the script moves it over README.md as the final step.
- Initialize-Template.ps1:
  - Rename files in docs/en-US/ that contain {{ModuleName}} (e.g.,
    about_{{ModuleName}}.help.md), parallel to the Public/Private/test
    Prefix-rename loop.
  - After renames, replace template-facing README.md with the now-substituted
    README.template.md.
  - Adjust the "Next steps" message to match the new flow.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- ManifestHelpers: strip SemVer build metadata in Split-SemVerString;
  use [bigint] (not [long]) for numeric prerelease comparison so large
  identifiers don't overflow.
- Initialize-Template: replace 'docs\en-US' and 'tests\Unit\{Public,Private}'
  with forward-slash child paths so docs/test renaming works on PS7+
  Linux/macOS.
- Manifest.tests: skip with a clear reason when requirements.psd1 has an
  empty/whitespace Version, instead of throwing inside Test-VersionConstraint.
- {{ModuleName}}.psm1: bare 'throw' in the dot-source catch to preserve
  the original ErrorRecord (was 'throw $_').
- about_{{ModuleName}}.help.md: drop trailing lone '-' that rendered as
  an empty bullet under KEYWORDS.
- README.md / README.template.md: label project-tree fence as 'text'
  (markdownlint MD040).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The existing CHANGELOG.md is the downstream-module starter (contains
{{Date}} and {{Prefix}}Example placeholders). Rename it to follow the
README.template.md convention so a separate CHANGELOG.md can hold the
template's own version history. Initialize-Template.ps1 will swap
CHANGELOG.template.md over CHANGELOG.md during init in a follow-up
commit.

Pure rename — no content change — so git log --follow stays clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Track changes to the PowerShell module template itself with its own
changelog, separate from the downstream-module starter changelog.

CHANGELOG.md (new) — template's own history. Uses Calendar Versioning
(YYYY.MM.DD) since the template has no API contract for SemVer to
describe; date-based answers the question downstream consumers actually
ask ("how stale is my init?"). First entry [2026.04.29] captures the
five chunks landed in the chore/template-sync branch.

Initialize-Template.ps1:
- Add CHANGELOG.md to the substitution-loop exclusion list. Without
  this, init would rewrite literal {{ModuleName}} mentions in the
  template's history to the user's chosen module name.
- After the README.template.md → README.md swap, add a parallel
  CHANGELOG.template.md → CHANGELOG.md swap so downstream modules
  receive the placeholder-laden starter changelog (the existing
  CHANGELOG.template.md, formerly CHANGELOG.md), not the template's
  own history.

tests/Manifest.tests.ps1:
- Skip the "Changelog and manifest versions are the same" assertion
  when running on the un-initialized template, where CHANGELOG.md
  holds the template's CalVer version which intentionally diverges
  from the {{ModuleName}}.psd1 ModuleVersion. Marker: presence of
  CHANGELOG.template.md (exists only pre-init; survives init's
  substitution loop because nothing in the path matches a placeholder
  token). The "valid version in changelog" assertion stays — PowerShell
  parses [Version]'2026.4.29' fine.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add a Changelog section to the template-facing README so visitors of
the template repo on GitHub can discover the version history.
Inserted between Requirements and License, with a one-line note that
the template uses CalVer rather than SemVer (so reviewers don't read
date-shaped numbers as broken SemVer).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 29, 2026 22:56
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

Warning

Rate limit exceeded

@tablackburn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 6 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 07139051-e3ed-4ffb-8cf2-5624550d68b7

📥 Commits

Reviewing files that changed from the base of the PR and between c1bab46 and 2a29c6b.

📒 Files selected for processing (14)
  • .gitattributes
  • .markdownlint-cli2.jsonc
  • CHANGELOG.md
  • CHANGELOG.template.md
  • Initialize-Template.ps1
  • PSScriptAnalyzerSettings.psd1
  • README.md
  • README.template.md
  • build.depend.psd1
  • docs/en-US/about_{{ModuleName}}.help.md
  • tests/Help.tests.ps1
  • tests/Manifest.tests.ps1
  • tests/ManifestHelpers.psm1
  • {{ModuleName}}/{{ModuleName}}.psm1
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/template-changelog

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 17 minutes and 6 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a template-level changelog (CalVer) so changes to the template itself are tracked separately from the downstream module’s starter changelog, and wires the init script/tests/docs to support the new split.

Changes:

  • Adds a template CHANGELOG.md (CalVer) and introduces CHANGELOG.template.md as the downstream-module starter changelog swapped in during initialization.
  • Updates Initialize-Template.ps1 to generate the downstream module CHANGELOG.md from CHANGELOG.template.md and to avoid placeholder substitution in the template changelog.
  • Updates manifest tests to skip changelog-vs-manifest version equality on the uninitialized template, and adds SemVer helper logic for dependency constraint checks.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
CHANGELOG.md Adds template-level CalVer changelog and release links.
CHANGELOG.template.md Adds downstream-module starter changelog template used post-init.
Initialize-Template.ps1 Excludes template changelog from substitution and swaps in module changelog template during init.
tests/Manifest.tests.ps1 Skips changelog/manifest equality for template; expands dependency version constraint assertions.
tests/ManifestHelpers.psm1 Introduces SemVer parsing/comparison helper exported for manifest tests.
README.md Updates template-facing README and links to template changelog.
README.template.md Adds module-facing README template including changelog link.
{{ModuleName}}/{{ModuleName}}.psm1 Adjusts dot-sourcing error handling to rethrow the original exception.
tests/Help.tests.ps1 Fixes parameter list variable used in help-vs-code assertions.
docs/en-US/about_{{ModuleName}}.help.md Adds about-help stub for initialized modules.
PSScriptAnalyzerSettings.psd1 Switches to structured analyzer settings layout.
build.depend.psd1 Bumps PSScriptAnalyzer dependency version.
.markdownlint-cli2.jsonc Adds markdownlint-cli2 configuration and ignore patterns.
.gitattributes Marks docs/en-US/* as generated for linguist.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/ManifestHelpers.psm1
Comment thread tests/Manifest.tests.ps1
Comment thread CHANGELOG.md Outdated
The Fixed entry described the change as `throw $_` → bare `throw`, but
`throw $_` was an intermediate state inside PR #14's review iterations.
The actual user-visible change from main was: a string `throw` (which
wrapped the original error in a fresh ErrorRecord) → bare `throw`
(which preserves the original ErrorRecord and stack trace).

Addresses Copilot inline review comment on PR #15.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tablackburn
Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@tablackburn
Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 30, 2026

✅ Actions performed

Full review triggered.

@tablackburn tablackburn merged commit eb80695 into main Apr 30, 2026
3 checks passed
@tablackburn tablackburn deleted the chore/template-changelog branch April 30, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants