Skip to content

Commit d187976

Browse files
committed
chore: add changelog template and update changelog generation in auto-release workflow
1 parent 83e4e47 commit d187976

File tree

3 files changed

+116
-71
lines changed

3 files changed

+116
-71
lines changed

.github/changelog-template.hbs

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
{{#each releases}}
9+
{{#if href}}
10+
## [{{title}}]({{href}}) - {{isoDate}}
11+
{{else}}
12+
## {{title}} - {{isoDate}}
13+
{{/if}}
14+
15+
{{#if summary}}
16+
{{summary}}
17+
{{/if}}
18+
19+
{{#if merges}}
20+
### Pull Requests
21+
{{#each merges}}
22+
- {{message}} {{#if href}}([#{{id}}]({{href}})){{/if}}
23+
{{/each}}
24+
25+
{{/if}}
26+
{{#each commits}}
27+
{{#unless breakingChanges}}
28+
- {{subject}}{{#if scope}} *[{{scope}}]*{{/if}} ([`{{shorthash}}`](https://github.com/canadianeagle/vite-plugin-component-debugger/commit/{{hash}})){{#if author}} by {{author.name}}{{/if}}
29+
{{/unless}}
30+
{{/each}}
31+
32+
{{#each fixes}}
33+
- {{commit.subject}} ([`{{commit.shorthash}}`](https://github.com/canadianeagle/vite-plugin-component-debugger/commit/{{commit.hash}})){{#if href}} fixes [#{{id}}]({{href}}){{/if}}
34+
{{/each}}
35+
36+
{{/each}}

.github/workflows/auto-release.yml

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,21 +97,37 @@ jobs:
9797
git push origin v${{ env.VERSION }}
9898
echo "Created and pushed tag v${{ env.VERSION }}"
9999
100-
- name: Generate changelog
100+
- name: Generate changelog and update file
101101
if: steps.check_release.outputs.skip == 'false'
102102
run: |
103-
# Create a simple changelog entry
104-
echo "## v${{ env.VERSION }} ($(date +'%Y-%m-%d'))" > release-notes.md
105-
echo "" >> release-notes.md
106-
echo "### Changes" >> release-notes.md
107-
# Get commits since last tag
108-
LAST_TAG=$(git describe --tags --abbrev=0 HEAD^)
109-
git log --oneline --pretty=format:"- %s" ${LAST_TAG}..HEAD >> release-notes.md
110-
echo "" >> release-notes.md
111-
echo "### Installation" >> release-notes.md
112-
echo "\`\`\`bash" >> release-notes.md
113-
echo "npm install --save-dev vite-plugin-component-debugger@${{ env.VERSION }}" >> release-notes.md
114-
echo "\`\`\`" >> release-notes.md
103+
# Install changelog generator
104+
npm install -g auto-changelog
105+
106+
# Generate changelog content using the custom template
107+
auto-changelog --stdout --commit-limit false -u --template ".github/changelog-template.hbs" --starting-version ${{ env.VERSION }} --issue-url "https://github.com/canadianeagle/vite-plugin-component-debugger/issues/{id}" > new-changelog-entry.md
108+
109+
# Prepare the new changelog entry
110+
# The output from auto-changelog includes the version header, so we can use it directly
111+
112+
# Read the existing changelog
113+
EXISTING_CHANGELOG=$(cat changelog.md)
114+
115+
# Create the new changelog content
116+
# The header is already in new-changelog-entry.md
117+
# We need to remove the old header from the existing changelog
118+
# This is a simple way to do it, might need adjustment based on your changelog format
119+
UPDATED_CHANGELOG=$(echo -e "$(cat new-changelog-entry.md)\n\n$(echo "$EXISTING_CHANGELOG" | sed '1,7d')")
120+
121+
# Write the updated changelog
122+
echo "$UPDATED_CHANGELOG" > changelog.md
123+
124+
# Also create release notes for the GitHub Release
125+
cp changelog.md release-notes.md
126+
127+
# Commit the updated changelog
128+
git add changelog.md
129+
git commit -m "chore: update changelog for v${{ env.VERSION }} [skip ci]"
130+
git push origin main
115131
116132
- name: Create GitHub Release
117133
if: steps.check_release.outputs.skip == 'false'

changelog.md

Lines changed: 51 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,76 @@
11
# Changelog
22

3-
All notable changes to vite-plugin-component-debugger will be documented in this file.
3+
All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased]
8+
## [Unreleased](https://github.com/canadianeagle/vite-plugin-component-debugger/compare/v2.0.0...HEAD) - 2025-09-30
99

10-
### Added
11-
- Initial release of vite-plugin-component-debugger
12-
- Automatic JSX/TSX element tagging with data attributes
13-
- Configurable options for customization
14-
- Support for excluding specific elements
15-
- Three.js/React Three Fiber element exclusion by default
16-
- Debug utilities for component inspection
17-
- TypeScript support with full type definitions
18-
- Comprehensive test suite
19-
- Documentation and examples
2010

21-
### Changed
22-
- N/A
11+
- refactor: streamline auto-release workflow and improve version checking logic ([`83e4e47`](https://github.com/canadianeagle/vite-plugin-component-debugger/commit/83e4e470a0d57f1785b0476e0b6049d8745b1ca4)) by
2312

24-
### Deprecated
25-
- N/A
2613

27-
### Removed
28-
- N/A
14+
## [v2.0.0](https://github.com/canadianeagle/vite-plugin-component-debugger/compare/v1.4.0...v2.0.0) - 2025-09-30
2915

30-
### Fixed
31-
- N/A
3216

33-
### Security
34-
- N/A
17+
### Pull Requests
18+
- v2.0.0: Major Feature Release with 10+ New Capabilities ([#6](https://github.com/canadianeagle/vite-plugin-component-debugger/pull/6))
3519

36-
## [1.0.0] - 2024-XX-XX
20+
- chore: release v1.4.0 [skip ci] ([`68427f3`](https://github.com/canadianeagle/vite-plugin-component-debugger/commit/68427f316498bfff45a076a3199427c03dcd04e6)) by
3721

38-
### Added
39-
- Initial public release
40-
- Core plugin functionality
41-
- Basic configuration options
42-
- Debug utilities
43-
- Documentation
4422

45-
---
23+
## [v1.4.0](https://github.com/canadianeagle/vite-plugin-component-debugger/compare/v1.3.1...v1.4.0) - 2025-09-30
4624

47-
## Version History Guide
4825

49-
### [1.0.1] - Patch Release Example
50-
- Fixed: Issue with TypeScript definitions
51-
- Fixed: Edge case in JSX parsing
26+
### Pull Requests
27+
- feat: add includeAttributes and excludeAttributes options for filtering data attributes ([#5](https://github.com/canadianeagle/vite-plugin-component-debugger/pull/5))
5228

53-
### [1.1.0] - Minor Release Example
54-
- Added: New configuration option for custom prefixes
55-
- Added: Support for MDX files
56-
- Improved: Performance optimizations
29+
- chore: release v1.3.1 [skip ci] ([`51afdd7`](https://github.com/canadianeagle/vite-plugin-component-debugger/commit/51afdd789b85d7353dcadc4cc9d6e2b6842d253f)) by
5730

58-
### [2.0.0] - Major Release Example
59-
- Breaking: Changed default attribute prefix
60-
- Breaking: Removed deprecated options
61-
- Added: New plugin architecture
31+
- feat: add includeAttributes and excludeAttributes options for filtering data attributes (#5) ([`2be7403`](https://github.com/canadianeagle/vite-plugin-component-debugger/commit/2be7403eff885afda17c7da562581c43f1f44477))
6232

63-
---
33+
## [v1.3.1](https://github.com/canadianeagle/vite-plugin-component-debugger/compare/v1.3.0...v1.3.1) - 2025-09-27
6434

65-
## How to Update This File
6635

67-
When releasing a new version:
36+
### Pull Requests
37+
- fix: handle multi-line JSX elements correctly when inserting attributes ([#3](https://github.com/canadianeagle/vite-plugin-component-debugger/pull/3))
6838

69-
1. Move items from [Unreleased] to a new version section
70-
2. Add the version number and date
71-
3. Add new [Unreleased] section for future changes
72-
4. Commit with message: "chore: update CHANGELOG for vX.X.X"
39+
- chore: release v1.3.0 [skip ci] ([`8929854`](https://github.com/canadianeagle/vite-plugin-component-debugger/commit/892985402187551742fe0a1c234046641a808a39)) by
40+
41+
42+
## [v1.3.0](https://github.com/canadianeagle/vite-plugin-component-debugger/compare/v1.2.0...v1.3.0) - 2025-09-19
43+
44+
45+
- feat: update default values for includeProps and includeContent to false for improved performance and less noise in the DOM ([`c40d02e`](https://github.com/canadianeagle/vite-plugin-component-debugger/commit/c40d02e566901ba83381c8b69aada8d3a1c295f8)) by
46+
- chore: release v1.2.0 [skip ci] ([`f6ac6bb`](https://github.com/canadianeagle/vite-plugin-component-debugger/commit/f6ac6bbf34bcca4f54391438e7675af99e5ce7ff)) by
47+
48+
49+
## [v1.2.0](https://github.com/canadianeagle/vite-plugin-component-debugger/compare/v1.1.0...v1.2.0) - 2025-09-19
50+
51+
52+
- feat: use componentDebugger for consistency and update related documentation and tests ([`94febd9`](https://github.com/canadianeagle/vite-plugin-component-debugger/commit/94febd9c308635c37fbdfe0e3895dab1bdef7f02)) by
53+
- chore: release v1.1.0 [skip ci] ([`aaecba6`](https://github.com/canadianeagle/vite-plugin-component-debugger/commit/aaecba6eb6c925e0e23120644f5a8648e170de4f)) by
54+
55+
56+
## [v1.1.0](https://github.com/canadianeagle/vite-plugin-component-debugger/compare/v1.0.1...v1.1.0) - 2025-09-19
57+
58+
59+
- feat: Add complex and nested components for testing line number accuracy ([`45881e3`](https://github.com/canadianeagle/vite-plugin-component-debugger/commit/45881e3dc47bea1af9cb31e19271c79791629cfe)) by
60+
- chore: release v1.0.1 [skip ci] ([`7ca8475`](https://github.com/canadianeagle/vite-plugin-component-debugger/commit/7ca84752c3c6a667c7a8ea1d898032fcf9727d9d)) by
61+
62+
63+
## v1.0.1 - 2025-09-19
64+
65+
66+
- chore: update code structure and remove redundant changes ([`81dd38b`](https://github.com/canadianeagle/vite-plugin-component-debugger/commit/81dd38b09dd1722db908f8277b2d06146b740471)) by
67+
- first commit ([`4ac7b57`](https://github.com/canadianeagle/vite-plugin-component-debugger/commit/4ac7b579eed78e4d0f5c0f40c640997fb1d53441)) by
68+
- chore: organize and clean up code structure for better maintainability ([`c17ffa7`](https://github.com/canadianeagle/vite-plugin-component-debugger/commit/c17ffa70e2c0fc2954bb144f71cfd1f42dbc864f)) by
69+
- feat: migrate workflows to pnpm for dependency management and build processes ([`06c9437`](https://github.com/canadianeagle/vite-plugin-component-debugger/commit/06c9437d7b41888f042ca3f4e04f35ec448d749a)) by
70+
- major: v1 release + add security policy and enhance README with additional badges and acknowledgments ([`f646374`](https://github.com/canadianeagle/vite-plugin-component-debugger/commit/f646374b6f0d458d78396dd793a12dee15e5499f)) by
71+
- chore: add commit message validation script and update documentation with examples ([`4d7cb34`](https://github.com/canadianeagle/vite-plugin-component-debugger/commit/4d7cb34dceed825bfc3bf2e0acad9bb3b0e6075d)) by
72+
- chore: add permissions for contents and packages in workflows ([`9b07043`](https://github.com/canadianeagle/vite-plugin-component-debugger/commit/9b07043ee419ab72d31bf53f6ac6715427bc87e6)) by
73+
- chore: update Node.js and pnpm versions in workflows and documentation ([`b9d96ef`](https://github.com/canadianeagle/vite-plugin-component-debugger/commit/b9d96efbc5c9027e2a6a810a8685c1c5f64cc9a5)) by
74+
- fix: update package check command to remove temporary files after packing ([`f76f05d`](https://github.com/canadianeagle/vite-plugin-component-debugger/commit/f76f05d7366729a7b53e3594c8ca123653d995ae)) by
7375

74-
Categories to use:
75-
- **Added** for new features
76-
- **Changed** for changes in existing functionality
77-
- **Deprecated** for soon-to-be removed features
78-
- **Removed** for now removed features
79-
- **Fixed** for any bug fixes
80-
- **Security** in case of vulnerabilities
8176

82-
[Unreleased]: https://github.com/yourusername/vite-plugin-component-debugger/compare/v1.0.0...HEAD
83-
[1.0.0]: https://github.com/yourusername/vite-plugin-component-debugger/releases/tag/v1.0.0

0 commit comments

Comments
 (0)