Skip to content

Commit aa63bb8

Browse files
authored
Add Changesets configuration and update development documentation (#1964)
Introduce Changesets for versioning and changelog generation, and enhance development documentation to guide contributors on using Changesets effectively.
1 parent c2ffd31 commit aa63bb8

File tree

6 files changed

+477
-8
lines changed

6 files changed

+477
-8
lines changed

.changeset/README.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/changelog.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
const changelogFunctions = {
2+
getReleaseLine: async (changeset, type, options) => {
3+
let prefix = '🎉';
4+
if (type === 'major') {
5+
prefix = '🎉';
6+
} else if (type === 'minor') {
7+
prefix = '🚀';
8+
} else if (type === 'patch') {
9+
prefix = '🐛';
10+
}
11+
if (changeset && changeset.summary) {
12+
const summary = changeset.summary || '';
13+
if (summary.indexOf('Docs') > -1) {
14+
prefix = '📝';
15+
}
16+
if (
17+
summary.indexOf('Chore') > -1 ||
18+
summary.indexOf('grafana-plugin-sdk-go') > -1 ||
19+
summary.indexOf('compiled') > -1
20+
) {
21+
prefix = '⚙️';
22+
}
23+
return [prefix, summary].join(' ');
24+
}
25+
return [prefix, changeset?.summary].join(' ');
26+
},
27+
getDependencyReleaseLine: async (changesets, dependenciesUpdated, options) => {
28+
return '\n';
29+
},
30+
};
31+
32+
module.exports = changelogFunctions;

.changeset/config.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "./changelog.js",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}

DEVELOPMENT_GUIDE.md renamed to CONTRIBUTING.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ make build-debug
2626
```
2727

2828
Then, configure your editor to connect to [delve](https://github.com/go-delve/delve) debugger running in headless mode. This is an example for VS Code:
29+
2930
```json
3031
{
3132
"version": "0.2.0",
@@ -36,10 +37,18 @@ Then, configure your editor to connect to [delve](https://github.com/go-delve/de
3637
"request": "attach",
3738
"mode": "remote",
3839
"port": 3222,
39-
"host": "127.0.0.1",
40-
},
40+
"host": "127.0.0.1"
41+
}
4142
]
4243
}
4344
```
4445

4546
Finally, run grafana-server and then execute `./debug-backend.sh` from grafana-zabbix root folder. This script will attach delve to running plugin. Now you can go to the VS Code and run _Debug backend plugin_ debug config.
47+
48+
## Submitting PR
49+
50+
If you are creating a PR, ensure to run `yarn changeset` from your branch. Provide the details accordingly. It will create `*.md` file inside `./.changeset` folder. Later during the release, based on these changesets, package version will be bumped and changelog will be generated.
51+
52+
## Releasing & Bumping version
53+
54+
To create a new release, execute `yarn changeset version`. This will update the Changelog and bump the version in `package.json` file. Commit those changes. Run the `Plugins - CD` GitHub Action to publish the new release.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
},
4343
"devDependencies": {
4444
"@babel/core": "^7.21.4",
45+
"@changesets/cli": "^2.27.12",
4546
"@grafana/eslint-config": "^6.0.0",
4647
"@grafana/plugin-e2e": "^1.17.1",
4748
"@grafana/tsconfig": "^1.2.0-rc1",

0 commit comments

Comments
 (0)