Skip to content

Commit

Permalink
() add update-changelog with template
Browse files Browse the repository at this point in the history
  • Loading branch information
mrTuomoK committed Feb 8, 2024
1 parent 301c849 commit 7efb89c
Show file tree
Hide file tree
Showing 4 changed files with 247 additions and 1 deletion.
116 changes: 116 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,122 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.X.X] - Month, XX, 202X

### React

#### Breaking

- [Component] What are the breaking changes?

#### Added

- [Component] What is added?

#### Changed

Changes that are not related to specific components
- [Component] What has been changed

#### Fixed

- [Component] What bugs/typos are fixed?

### Core

#### Breaking

- [Component] What are the breaking changes?

#### Added

- [Component] What is added?

#### Changed

Changes that are not related to specific components
- [Component] What has been changed

#### Fixed

- [Component] What bugs/typos are fixed?

### Documentation

#### Breaking

- [Component] What are the breaking changes?

#### Added

- [Component] What is added?

#### Changed

Changes that are not related to specific components
- [Component] What has been changed

#### Fixed

- [Component] What bugs/typos are fixed?

### Figma

#### Breaking

- [Component] What are the breaking changes?

#### Added

- [Component] What is added?

#### Changed

Changes that are not related to specific components
- [Component] What has been changed

#### Fixed

- [Component] What bugs/typos are fixed?

### Sketch/Abstract

#### Breaking

- [Component] What are the breaking changes?

#### Added

- [Component] What is added?

#### Changed

Changes that are not related to specific components
- [Component] What has been changed

#### Fixed

- [Component] What bugs/typos are fixed?

### Hds-js

#### Breaking

- [Component] What are the breaking changes?

#### Added

- [Component] What is added?

#### Changed

Changes that are not related to specific components
- [Component] What has been changed

#### Fixed

- [Component] What bugs/typos are fixed?

## [3.5.0] - February, 6, 2024

### React
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"start:core": "lerna run --scope hds-core start",
"start:react": "lerna run --scope hds-react start",
"release": "lerna publish from-package --yes",
"update-versions": "lerna version --exact --no-git-tag-version --no-push --amend --yes"
"update-versions": "lerna version --exact --no-git-tag-version --no-push --amend --yes",
"update-changelog": "node ./scripts/changelog/update-changelog.js"
},
"devDependencies": {
"lerna": "^7.0.1",
Expand Down
116 changes: 116 additions & 0 deletions scripts/changelog/CHANGELOG.template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
## [3.X.X] - Month, XX, 202X

### React

#### Breaking

- [Component] What are the breaking changes?

#### Added

- [Component] What is added?

#### Changed

Changes that are not related to specific components
- [Component] What has been changed

#### Fixed

- [Component] What bugs/typos are fixed?

### Core

#### Breaking

- [Component] What are the breaking changes?

#### Added

- [Component] What is added?

#### Changed

Changes that are not related to specific components
- [Component] What has been changed

#### Fixed

- [Component] What bugs/typos are fixed?

### Documentation

#### Breaking

- [Component] What are the breaking changes?

#### Added

- [Component] What is added?

#### Changed

Changes that are not related to specific components
- [Component] What has been changed

#### Fixed

- [Component] What bugs/typos are fixed?

### Figma

#### Breaking

- [Component] What are the breaking changes?

#### Added

- [Component] What is added?

#### Changed

Changes that are not related to specific components
- [Component] What has been changed

#### Fixed

- [Component] What bugs/typos are fixed?

### Sketch/Abstract

#### Breaking

- [Component] What are the breaking changes?

#### Added

- [Component] What is added?

#### Changed

Changes that are not related to specific components
- [Component] What has been changed

#### Fixed

- [Component] What bugs/typos are fixed?

### Hds-js

#### Breaking

- [Component] What are the breaking changes?

#### Added

- [Component] What is added?

#### Changed

Changes that are not related to specific components
- [Component] What has been changed

#### Fixed

- [Component] What bugs/typos are fixed?

13 changes: 13 additions & 0 deletions scripts/changelog/update-changelog.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* This takes the CHANGELOG.md and prepends the CHANGELOG.template.md to it.
*/

const fs = require('fs');
const changeLogFile = './CHANGELOG.md';

const old = fs.readFileSync(changeLogFile, 'utf8');
const template = fs.readFileSync('./scripts/changelog/CHANGELOG.template.md', 'utf8');
const latestVersionPosition = old.indexOf('## [');
changeLogWithTemplate = old.substring(0, latestVersionPosition) + template + old.substring(latestVersionPosition);

fs.writeFileSync(changeLogFile, changeLogWithTemplate);

0 comments on commit 7efb89c

Please sign in to comment.