{"_id":"@bioinsights/release-it-gitlab-mr-changelog","_rev":"4-95b5cec20db54520876bc234e0643c80","name":"@bioinsights/release-it-gitlab-mr-changelog","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@bioinsights/release-it-gitlab-mr-changelog","version":"1.0.0","keywords":["release-it-plugin","gitlab","changelog","merge-requests"],"_id":"@bioinsights/release-it-gitlab-mr-changelog@1.0.0","maintainers":[{"name":"bioinsights","email":"serdar@bioinsights.com"}],"dist":{"shasum":"a5cf9c4dc3731f0fcbe3eedac07b5236dfb96083","tarball":"https://registry.npmjs.org/@bioinsights/release-it-gitlab-mr-changelog/-/release-it-gitlab-mr-changelog-1.0.0.tgz","fileCount":3,"integrity":"sha512-Aw73GzudnBNMYz4YzWyasieHa9maxdqfl3bBjdNW48NvoewtB/VPHIULFS9vRQIbIJWMSGOSZEE4cPG/aSd9hg==","signatures":[{"sig":"MEUCIQCJzM1OCvwOJSeM+QTE4d2Z6EivfsXcMcnCa3jMnAcVKQIgBgEZu/6JvYkqf+hAPOq/3sGN4mFlMFH/HyfSr1VzEGI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18490},"main":"index.js","gitHead":"52f0585034ec1f0bb332fba75ab4de3eb3361554","_npmUser":{"name":"bioinsights","email":"serdar@bioinsights.com"},"_npmVersion":"10.9.2","description":"A release-it plugin that generates a changelog from GitLab merge requests using conventional-changelog format","directories":{},"_nodeVersion":"22.17.1","dependencies":{"release-it":"^15.0.0"},"_hasShrinkwrap":false,"peerDependencies":{"release-it":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/release-it-gitlab-mr-changelog_1.0.0_1753995321395_0.06844314383919858","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bioinsights/release-it-gitlab-mr-changelog","version":"1.0.1","keywords":["release-it-plugin","gitlab","changelog","merge-requests"],"_id":"@bioinsights/release-it-gitlab-mr-changelog@1.0.1","maintainers":[{"name":"bioinsights","email":"serdar@bioinsights.com"}],"dist":{"shasum":"e6d76b51d278fd6d6c523e06462b9ec963b18d1b","tarball":"https://registry.npmjs.org/@bioinsights/release-it-gitlab-mr-changelog/-/release-it-gitlab-mr-changelog-1.0.1.tgz","fileCount":3,"integrity":"sha512-3C1IYN7Y01BND15geshOK/j3VjwZfZM27RjPn/yDZvfD+NrPnfvqjoaP0RuU3bIybCzp1r4DKYqjL5xOZCAMDQ==","signatures":[{"sig":"MEUCIQCOaCqHeBY3XIlG/9PAqSdBW1yQr3jr4TOE1bFac0AftwIgJ+8I86PftfA6vLjLZA5GTeybU8mrdjq+9O86GnkWE1o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18606},"main":"index.js","gitHead":"40608a36295610a99a4a979d950e81e1bfbd9b58","_npmUser":{"name":"bioinsights","email":"serdar@bioinsights.com"},"_npmVersion":"10.9.2","description":"A release-it plugin that generates a changelog from GitLab merge requests using conventional-changelog format","directories":{},"_nodeVersion":"22.17.1","dependencies":{"release-it":"^15.0.0"},"_hasShrinkwrap":false,"peerDependencies":{"release-it":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/release-it-gitlab-mr-changelog_1.0.1_1753996658426_0.5615302386460503","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@bioinsights/release-it-gitlab-mr-changelog","version":"1.0.2","keywords":["release-it-plugin","gitlab","changelog","merge-requests"],"_id":"@bioinsights/release-it-gitlab-mr-changelog@1.0.2","maintainers":[{"name":"bioinsights","email":"serdar@bioinsights.com"}],"dist":{"shasum":"cf3f2af65c9fd0e676717e983bbc7db492a945c5","tarball":"https://registry.npmjs.org/@bioinsights/release-it-gitlab-mr-changelog/-/release-it-gitlab-mr-changelog-1.0.2.tgz","fileCount":4,"integrity":"sha512-cZSZupxVRb5twF7aLg/ZKVIvPJDP8UTdIM+KtHYxPisAeCn2kcIlQiZNuyrvzeqbuvYeu3FlojsX4lIpFeCzvQ==","signatures":[{"sig":"MEUCIQDVkwl11UAvdgeh0LglDtakGTGaWxWICqJ8pG+3DQ57uAIgAQb9EAEq2w7cUlEyEqDwPPgj8y2oI4IcDFzud35wEkc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23493},"main":"index.js","gitHead":"306285653add553255cf1bafc395ad81002b3cfb","_npmUser":{"name":"bioinsights","email":"serdar@bioinsights.com"},"_npmVersion":"10.9.2","description":"A release-it plugin that generates a changelog from GitLab merge requests using conventional-changelog format","directories":{},"_nodeVersion":"22.17.1","dependencies":{"release-it":"^15.0.0"},"_hasShrinkwrap":false,"peerDependencies":{"release-it":"^15.0.0"},"_npmOperationalInternal":{"tmp":"tmp/release-it-gitlab-mr-changelog_1.0.2_1753997501683_0.7474431282264598","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@bioinsights/release-it-gitlab-mr-changelog","version":"1.0.3","description":"A release-it plugin that generates a changelog from GitLab merge requests using conventional-changelog format","main":"index.js","keywords":["release-it-plugin","gitlab","changelog","merge-requests"],"dependencies":{"release-it":"^15.0.0"},"peerDependencies":{"release-it":"^15.0.0"},"_id":"@bioinsights/release-it-gitlab-mr-changelog@1.0.3","gitHead":"96e36535295d724b91516622aa75f20dda62efb3","_nodeVersion":"22.17.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-4WpL/xxLL3k+99vp1lXGN8rf/hIuqb8D04iKE+En+gjiQV5S2/q34r8QPrD3egNiRHcbl00I6aUv04zt+tag1w==","shasum":"56c6655567ab69cb9734a081ce54eb8e157347fc","tarball":"https://registry.npmjs.org/@bioinsights/release-it-gitlab-mr-changelog/-/release-it-gitlab-mr-changelog-1.0.3.tgz","fileCount":4,"unpackedSize":24177,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICRRkKc8DW15QdruQW5icNl+CnaDyGYpAV1GFZQy0Jz6AiB60AGtnBoDnozk1R2OlmXX5LLoeDHvAn96Q931cWhj2Q=="}]},"_npmUser":{"name":"bioinsights","email":"serdar@bioinsights.com"},"directories":{},"maintainers":[{"name":"bioinsights","email":"serdar@bioinsights.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/release-it-gitlab-mr-changelog_1.0.3_1753997904753_0.024445317162245628"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-31T20:55:20.985Z","modified":"2025-07-31T21:38:25.126Z","1.0.0":"2025-07-31T20:55:21.595Z","1.0.1":"2025-07-31T21:17:38.617Z","1.0.2":"2025-07-31T21:31:41.836Z","1.0.3":"2025-07-31T21:38:24.953Z"},"keywords":["release-it-plugin","gitlab","changelog","merge-requests"],"description":"A release-it plugin that generates a changelog from GitLab merge requests using conventional-changelog format","maintainers":[{"name":"bioinsights","email":"serdar@bioinsights.com"}],"readme":"# release-it-gitlab-mr-changelog\n\nA [release-it](https://github.com/release-it/release-it) plugin that generates a changelog from GitLab merge requests.\n\n## Overview\n\nThis plugin fetches merged merge requests directly from GitLab API and generates a changelog based on them. It categorizes merge requests into Features, Bug Fixes, and Other Changes based on their titles and labels, and groups them between release dates. The plugin handles API errors gracefully and will generate an empty changelog if it can't fetch data from the API.\n\n## Installation\n\n```bash\n# Local installation\nnpm install --save-dev ./plugins/release-it-gitlab-mr-changelog\n```\n\n## Usage\n\nIn your `.release-it.js` configuration file:\n\n```javascript\nmodule.exports = {\n  plugins: {\n    './plugins/release-it-gitlab-mr-changelog': {\n      infile: 'CHANGELOG.md'\n    }\n  }\n};\n```\n\n## Configuration\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `infile` | String | `'CHANGELOG.md'` | The file to write the changelog to |\n| `header` | String | `'# Changelog'` | The header to use for the changelog file |\n| `origin` | String | Derived from repo | The base URL for GitLab |\n\n## Required Environment Variables\n\nThe plugin requires the following environment variables to be set:\n\n| Variable | Description | Required |\n|----------|-------------|-------------|\n| `GITLAB_TOKEN` | Your GitLab personal access token with API access | Yes|\n| `CI_PROJECT_ID` | The ID of your GitLab project | Yes\n| `CI_API_V4_URL` | The base URL for the GitLab API (e.g., `https://gitlab.example.com/api/v4`) | Yes\n\nThese variables are typically available in GitLab CI/CD pipelines by default except GITLAB_TOKEN, you need to provide GITLAB_TOKEN in ci/cd pipeline variables. For local development, you can set them in your environment or in a `.env` file.\n\n## How It Works\n\n1. The plugin fetches merged merge requests directly from the GitLab API using the provided environment variables.\n2. It also fetches releases from the GitLab API to determine release dates.\n3. It filters merge requests that were merged between the previous release date and the current release date.\n4. It categorizes merge requests based on their titles and labels:\n   - Features: Titles starting with \"feat\" or containing \"feature\", or with the \"Feature\" label\n   - Bug Fixes: Titles starting with \"fix\" or containing \"bug\", or with the \"Bug fix\" label\n   - Other Changes: All other merge requests\n5. It extracts only the values inside parentheses from merge request titles (e.g., from \"feat(user-auth)\" it extracts \"user-auth\").\n6. It generates a changelog with sections for each category.\n7. It writes the changelog to the specified file.\n\n## Example Output\n\nThe plugin generates a changelog that looks like this:\n\n```markdown\n## [1.0.0](https://gitlab.example.com/example/project/compare/v0.9.0...v1.0.0) (2025-07-31)\n\n### Features\n\n* user-auth ([!101](https://gitlab.example.com/project/merge_requests/101))\n\n### Bug Fixes\n\n* api ([!102](https://gitlab.example.com/project/merge_requests/102))\n\n### Other Changes\n\n* deps ([!103](https://gitlab.example.com/project/merge_requests/103))\n```\n\nNote that only the content inside parentheses is displayed in the changelog entries, without prefixes like \"feat\" or \"fix\".\n\n## Example Script for Testing\n\nYou can test the plugin with the following script:\n\n```javascript\n// Set environment variables\nprocess.env.GITLAB_TOKEN = 'your_gitlab_token';\nprocess.env.CI_PROJECT_ID = 'your_project_id';\nprocess.env.CI_API_V4_URL = 'https://gitlab.example.com/api/v4';\n\n// Import the plugin\nconst GitlabMergeRequestChangelog = require('./plugins/release-it-gitlab-mr-changelog');\n\n// Create an instance of the plugin\nconst plugin = new GitlabMergeRequestChangelog({\n  namespace: 'gitlab-mr-changelog',\n  options: {\n    'gitlab-mr-changelog': {\n      infile: 'CHANGELOG.md'\n    }\n  },\n  container: {\n    // Mock container with required methods\n    config: {\n      getContext: () => ({\n        version: '1.0.0',\n        tagName: 'v1.0.0',\n        previousTag: 'v0.9.0',\n        repo: {\n          host: 'gitlab.example.com',\n          repository: 'your-project'\n        }\n      }),\n      isDryRun: false\n    },\n    log: {\n      warn: console.warn,\n      exec: console.log\n    }\n  }\n});\n\n// Test the plugin\nasync function testPlugin() {\n  try {\n    await plugin.init();\n    const changelog = await plugin.getChangelog('0.9.0');\n    console.log(changelog);\n  } catch (error) {\n    console.error('Error:', error);\n  }\n}\n\ntestPlugin();\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}