@bonvoy/plugin-gitlab 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +93 -0
- package/package.json +44 -0
package/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# @bonvoy/plugin-gitlab 🚢
|
|
2
|
+
|
|
3
|
+
> GitLab releases and MR plugin for bonvoy
|
|
4
|
+
|
|
5
|
+
Creates GitLab releases with changelogs and manages release merge requests.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @bonvoy/plugin-gitlab
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- ✅ Creates GitLab releases for each published package
|
|
16
|
+
- ✅ Creates release MRs for PR-based workflow
|
|
17
|
+
- ✅ Auto-detects project from package.json or git remote
|
|
18
|
+
- ✅ Includes changelog as release description
|
|
19
|
+
- ✅ Custom GitLab host support (self-hosted)
|
|
20
|
+
- ✅ Dry-run support
|
|
21
|
+
|
|
22
|
+
## Configuration
|
|
23
|
+
|
|
24
|
+
```javascript
|
|
25
|
+
// bonvoy.config.js
|
|
26
|
+
export default {
|
|
27
|
+
gitlab: {
|
|
28
|
+
token: process.env.GITLAB_TOKEN, // default
|
|
29
|
+
host: 'https://gitlab.com', // default, or self-hosted URL
|
|
30
|
+
projectId: 'my-group/my-project', // optional, auto-detected
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Hooks
|
|
36
|
+
|
|
37
|
+
This plugin taps into the following hooks:
|
|
38
|
+
|
|
39
|
+
| Hook | Action |
|
|
40
|
+
|------|--------|
|
|
41
|
+
| `makeRelease` | Creates GitLab releases for published packages |
|
|
42
|
+
| `createPR` | Creates a release MR with version bumps and changelog |
|
|
43
|
+
|
|
44
|
+
## Requirements
|
|
45
|
+
|
|
46
|
+
- `GITLAB_TOKEN` environment variable with `api` scope
|
|
47
|
+
- For self-hosted: `GITLAB_HOST` environment variable (optional)
|
|
48
|
+
|
|
49
|
+
## Project Detection
|
|
50
|
+
|
|
51
|
+
The plugin auto-detects the project in this order:
|
|
52
|
+
|
|
53
|
+
1. Config option (`projectId`)
|
|
54
|
+
2. `package.json` repository field
|
|
55
|
+
3. Git remote URL
|
|
56
|
+
|
|
57
|
+
Supported URL formats:
|
|
58
|
+
- `https://gitlab.com/group/project`
|
|
59
|
+
- `https://gitlab.com/group/subgroup/project`
|
|
60
|
+
- `git@gitlab.com:group/project.git`
|
|
61
|
+
|
|
62
|
+
## Environment Variables
|
|
63
|
+
|
|
64
|
+
| Variable | Description |
|
|
65
|
+
|----------|-------------|
|
|
66
|
+
| `GITLAB_TOKEN` | GitLab personal access token |
|
|
67
|
+
| `GITLAB_HOST` | GitLab host URL (default: `https://gitlab.com`) |
|
|
68
|
+
|
|
69
|
+
## MR Workflow
|
|
70
|
+
|
|
71
|
+
When using `bonvoy prepare`, this plugin:
|
|
72
|
+
|
|
73
|
+
1. Creates an MR from the release branch to the base branch
|
|
74
|
+
2. Sets MR title and description with version bumps and changelog
|
|
75
|
+
3. Stores MR info in `.bonvoy/release-pr.json` for merge detection
|
|
76
|
+
|
|
77
|
+
## Usage
|
|
78
|
+
|
|
79
|
+
To use GitLab instead of GitHub, disable the GitHub plugin:
|
|
80
|
+
|
|
81
|
+
```javascript
|
|
82
|
+
// bonvoy.config.js
|
|
83
|
+
export default {
|
|
84
|
+
plugins: [
|
|
85
|
+
'@bonvoy/plugin-gitlab',
|
|
86
|
+
// GitHub plugin is disabled when GitLab is explicitly added
|
|
87
|
+
],
|
|
88
|
+
};
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## License
|
|
92
|
+
|
|
93
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bonvoy/plugin-gitlab",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "🚢 GitLab releases plugin for bonvoy",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"bonvoy",
|
|
7
|
+
"plugin",
|
|
8
|
+
"gitlab",
|
|
9
|
+
"release"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://github.com/Zweer/bonvoy#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/Zweer/bonvoy/issues"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/Zweer/bonvoy.git",
|
|
18
|
+
"directory": "packages/plugin-gitlab"
|
|
19
|
+
},
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"author": {
|
|
22
|
+
"name": "Zweer",
|
|
23
|
+
"email": "n.olivieriachille@gmail.com"
|
|
24
|
+
},
|
|
25
|
+
"type": "module",
|
|
26
|
+
"exports": {
|
|
27
|
+
".": "./dist/index.mjs",
|
|
28
|
+
"./package.json": "./package.json"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "tsdown",
|
|
35
|
+
"test": "vitest"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@bonvoy/core": "^0.1.0",
|
|
39
|
+
"@gitbeaker/rest": "^42.5.0"
|
|
40
|
+
},
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">= 20.5"
|
|
43
|
+
}
|
|
44
|
+
}
|