feat(ci): add git-cliff to update the CHANGELOG.md

This commit is contained in:
Thomas Rupprecht 2023-02-04 02:50:44 +01:00
parent bae19bff3c
commit 4e17127714
4 changed files with 358 additions and 1 deletions

185
CHANGELOG.md Normal file
View File

@ -0,0 +1,185 @@
# Changelog
All notable changes to this project will be documented in this file.
## [unreleased]
### Other
- Add pre-commit hook with husky
## [0.9.1] - 2023-01-22
### Other
- Extract code into setBadgeStatus and createStatusChangedNotification function
- Don't fetch data if offline
- Replace web-ext types package
- Await init
- Add link to Pad
## [0.9.0] - 2023-01-20
### Other
- Manifest_v3
- Update to manifest_version v3
- Make code compatible with manifest_version v3
## [0.8.7] - 2023-01-20
### Other
- Add badges to README
- Improve README
- Improve badges
- Improve config
- Use globalThis instead of window to also work in service worker
- Remove unnecessary permissions
- Remove persistent flag in manifest config
- Open usrspace.at homepage on install
## [0.8.6] - 2023-01-05
### Other
- Change addon id to currently used one
## [0.8.5] - 2023-01-05
### Other
- Add web-ext-config.js and add watch scripts
- Improve README
- Add development docs
- Inject browser-polyfill only in chromium builds
- Add addon id
## [0.8.4] - 2023-01-05
### Other
- Use html template tag
- Change strict_min_version to v79
- Simplify updateSpaceApiJson
- Add lint script
## [0.8.3] - 2023-01-04
### Other
- Update strict_min_version to 57.0
## [0.8.2] - 2023-01-04
### Other
- Explicit set persistent=true and add browser_specific_settings in manifest.json
- Set html lang by browser language
- Improve popup styling
## [0.8.1] - 2022-12-25
### Bug Fixes
- Fix copy-version script
### Other
- Manifest l10n
- Faster data fetching, badge improvements
- Cursor pointer on clickable elements
- Move manifest and _locales into src
- Update package-lock
- Store data in localStorage
- Use storage api
- Use browser.alarms api
- Unfiy codestyle
- Cleanup data on startup
## [0.8.0] - 2022-12-24
### Other
- Improve code, doc, tooling
- Npm version scripts
- Copy browser-polyfill
- Import config as module
- Move code into src dir
- Add JsDoc and small code improvements
- Add build script
- Improve code
- Remove old icons
- Add l10n
- Cleanup manifest.json
- Increase svg size
- Set build filename
## [0.7] - 2021-11-06
### Bug Fixes
- Fix new urls
- Fix dates if no date is found
- Fix data, remove logging, improve code
### Other
- Change spaceApiUrl and nextcloud label
- Add release info
- Add editorconfig
- Reformat code
- Add package.json for typescript type definitions
- Use template strings
- Format datetime
- Change to normal function and use async/await
- Use css variables and prepare for dark mode support
- Add Nunito font
- Change icons, enable darkmode, improve styling
- Update license
- Change icon
- Remove old html code and load right svg
## [0.4] - 2019-10-04
### Bug Fixes
- Fix wrong icon
## [0.3] - 2019-10-04
### Other
- Improve popup content
## [0.2] - 2019-08-28
### Bug Fixes
- Fix icon style
- Fix compatibility with chromium based browsers
- Fix typo
### Other
- Init
- Add first readme
- Add LICENSE and improve README
- Add icons and improve styling
- Improve styling
- Use config
- Offen/Geschlossen-Info schön im Pop-Up
- Merge branch 'open-info-popup' into 'master'
Offen/Geschlossen-Info schön im Pop-Up
See merge request XimeX/usrspace-browser-addon!1
- Add space status change notification
- Small fix
- Make text over icon more readable
- Switch from GitLab to Gitea
- Merge branch 'master' of pludi/usrspace-browser-addon into master
- Missing change from Gitlab to Gitea
- Update browser-polyfill
- Add sections
- Add time element for event date
- Improve badge color
- Combine updateBadge promises
- Check for online/offline events if fetching should be enabled
<!-- generated by git-cliff -->

74
cliff.toml Normal file
View File

@ -0,0 +1,74 @@
# configuration file for git-cliff
# see https://github.com/orhun/git-cliff#configuration-file
[changelog]
# changelog header
header = """
# Changelog\n
All notable changes to this project will be documented in this file.\n
"""
# template for the changelog body
# https://tera.netlify.app/docs/#introduction
body = """
{% if version %}\
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits %}\
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first | trim_end | replace(from="\n\n", to="\n") }}
{% endfor %}\
{% endfor %}\n\n
"""
# remove the leading and trailing whitespace from the template
trim = true
# changelog footer
footer = """
<!-- generated by git-cliff -->
"""
[git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = true
# filter out the commits that are not conventional
filter_unconventional = false
# process each line of a commit as an individual commit
split_commits = false
# regex for preprocessing the commit messages
commit_preprocessors = [
# { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/orhun/git-cliff/issues/${2}))"}, # replace issue numbers
]
# regex for parsing and grouping commits
commit_parsers = [
{ message = "^feat", group = "Features"},
{ message = "^fix", group = "Bug Fixes"},
{ message = "^doc", group = "Documentation"},
{ message = "^perf", group = "Performance"},
{ message = "^refactor", group = "Refactor"},
{ message = "^style", group = "Styling"},
{ message = "^test", group = "Testing"},
{ message = "^chore\\(release\\): prepare for", skip = true},
{ message = "^chore", group = "Miscellaneous Tasks"},
{ body = ".*security", group = "Security"},
{ message = "^[0-9]+.[0-9]+.[0-9]+", skip = true},
{ message = "^release v0.[0-9]", skip = true},
{ message = ".*", group = "Other", default_scope = "other"},
]
# protect breaking changes from being skipped due to matching a skipping commit_parser
protect_breaking_commits = false
# filter out the commits that are not matched by commit parsers
filter_commits = false
# glob pattern for matching git tags
tag_pattern = "v[0-9]*"
# regex for skipping tags
skip_tags = ""
# regex for ignoring tags
ignore_tags = ""
# sort the tags topologically
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "oldest"
# limit the number of commits included in the changelog.
# limit_commits = 42

96
package-lock.json generated
View File

@ -14,6 +14,7 @@
},
"devDependencies": {
"@types/firefox-webext-browser": "^109.0.0",
"git-cliff": "^1.1.2",
"husky": "^8.0.0"
}
},
@ -23,6 +24,101 @@
"integrity": "sha512-tkEjBP/zZxaS5bv8MH/0kUs3WeUm8KU3Ew1B9BtQQdq5PwtG23SXvAbjxjMSQpoIzbxyWG4Yu4mi1uB2S8W7ng==",
"dev": true
},
"node_modules/git-cliff": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/git-cliff/-/git-cliff-1.1.2.tgz",
"integrity": "sha512-sjIhRW8BZSKkr0e9XcEFdxz2SF7lcOOJJuEEc+b07H7zM7WdhLh5dzZM2Et57adC5jUVO6mLpxuWRJSinGl4nQ==",
"dev": true,
"bin": {
"git-cliff": "lib/index.js"
},
"optionalDependencies": {
"git-cliff-darwin-arm64": "1.1.2",
"git-cliff-darwin-x64": "1.1.2",
"git-cliff-linux-arm64": "1.1.2",
"git-cliff-linux-x64": "1.1.2",
"git-cliff-windows-arm64": "1.1.2",
"git-cliff-windows-x64": "1.1.2"
}
},
"node_modules/git-cliff-darwin-arm64": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/git-cliff-darwin-arm64/-/git-cliff-darwin-arm64-1.1.2.tgz",
"integrity": "sha512-z+pSh6vLrtgoILlWzhisLHiLOuStabJh/ShgbBq0q3JRedUmxfg6WqCi+fHymMkA4AeoXOIS7GGfyV5m+sLQeQ==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"darwin"
]
},
"node_modules/git-cliff-darwin-x64": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/git-cliff-darwin-x64/-/git-cliff-darwin-x64-1.1.2.tgz",
"integrity": "sha512-dhizA8pGobcxxTS2YQDSs960zFqKfjprDsX/pq+MqgEc68e60B2WSRwFWXd+jK2x/7d7PbnMzlXDqszeDwBpRQ==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"darwin"
]
},
"node_modules/git-cliff-linux-arm64": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/git-cliff-linux-arm64/-/git-cliff-linux-arm64-1.1.2.tgz",
"integrity": "sha512-4TYzQHO8H8FquSxoO/O2IfYN6ZLef4SM5PEDG93jeK958s+/FWnFok8evGSJdoTeyu2MXWdw4J40o1AKl0fcxw==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"linux"
]
},
"node_modules/git-cliff-linux-x64": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/git-cliff-linux-x64/-/git-cliff-linux-x64-1.1.2.tgz",
"integrity": "sha512-vDLQEITUPHliKVWD69baH1djdsCPpSgUqqbNdX5Xb4bzM8vugIwfpV0XE/BIDC05VUJY2TPLMK1Zh//pdaOhfg==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"linux"
]
},
"node_modules/git-cliff-windows-arm64": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/git-cliff-windows-arm64/-/git-cliff-windows-arm64-1.1.2.tgz",
"integrity": "sha512-wl1S3IU5ewZ6UYzPFZbTZjeyf6/3VIAjDQ0hFWN+LQeo6ttj5RtVzifMRadoCmb2Jgi9RT8qR4plwyL+/NtHlQ==",
"cpu": [
"arm64"
],
"dev": true,
"optional": true,
"os": [
"win32"
]
},
"node_modules/git-cliff-windows-x64": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/git-cliff-windows-x64/-/git-cliff-windows-x64-1.1.2.tgz",
"integrity": "sha512-KszFq4Pre+TdJiPuGP+4t1DtXHcVaF9/dBSmwldxWvyAomzeX2wHalquh2iv6YgcFUQ4oe/DP1qiNhLa5xw5/Q==",
"cpu": [
"x64"
],
"dev": true,
"optional": true,
"os": [
"win32"
]
},
"node_modules/husky": {
"version": "8.0.3",
"resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz",

View File

@ -7,6 +7,7 @@
},
"devDependencies": {
"@types/firefox-webext-browser": "^109.0.0",
"git-cliff": "^1.1.2",
"husky": "^8.0.0"
},
"scripts": {
@ -14,6 +15,7 @@
"inject-browser-polyfill": "sed -i -r 's/(<!-- \\[INJECT-BROWSER-POLYFILL] -->).*/\\1<script type=\"module\" src=\"browser-polyfill.js\"><\\/script>/' src/*.html",
"uninject-browser-polyfill": "sed -i -r 's/(<!-- \\[INJECT-BROWSER-POLYFILL] -->).+/\\1/' src/*.html",
"copy-version": "sed -i 's/^\t\"version\": \".*\",$/\t\"version\": \"'$(rg '^\t\"version\": \"(.+)\",$' -r '$1' < package.json)'\",/' src/manifest.json",
"update-changelog": "npm exec git-cliff > CHANGELOG.md",
"lint": "web-ext lint -w",
"test": "echo \"Error: no test specified\" && exit 0",
"watch:firefox": "web-ext run -t firefox-desktop",
@ -28,7 +30,7 @@
"postbuild:firefox": "npm run postbuild",
"postbuild:chromium": "npm run postbuild && npm run uninject-browser-polyfill",
"postinstall": "npm run copy-browser-polyfill",
"preversion": "npm run lint && npm test",
"preversion": "npm run lint && npm test && npm run update-changelog",
"version": "npm run copy-version && git add -u",
"postversion": "npm run build:firefox",
"prepare": "husky install"