Skip to content

Plugin System for Changelogen #285

@mmeester

Description

@mmeester

Describe the feature

Problem

Users often need to extend changelogen with custom functionality like:

  • Integrating with issue trackers (Jira, Linear, etc.)
  • Adding custom formatting or sections
  • Sending notifications (Slack, Discord, etc.)
  • Organization-specific workflow customizations

Currently, this requires forking the project or complex workarounds.

Proposed Solution

Add a plugin system that allows users to extend changelogen through configuration:

// changelog.config.js
export default {
  plugins: {
    "@changelogen/jira-plugin": {
      baseUrl: "https://company.atlassian.net",
      projectKeys: ["PROJ", "TASK"],
    },
    "./custom-plugin.js": {
      customOption: "value",
    },
  },
};

Plugin Example: Jira Integration

export class JiraPlugin {
  name = "jira-plugin";

  afterCommitParsing(commits) {
    return commits.map((commit) => {
      // Find Jira tickets in commit message (e.g., "PROJ-123")
      const tickets = this.extractJiraTickets(commit.message);

      // Add clickable links to changelog
      tickets.forEach((ticket) => {
        commit.references.push({
          type: "jira-ticket",
          value: ticket,
          url: `${this.config.baseUrl}/browse/${ticket}`,
        });
      });

      return commit;
    });
  }
}

Key Features

  • Hook-based architecture with lifecycle events (init, beforeCommitParsing, afterCommitParsing, etc.)
  • NPM package support (@changelogen/plugin-name) and local plugins
  • Type-safe with full TypeScript support
  • Zero breaking changes - completely backward compatible
  • Error handling - plugin failures don't break core functionality

Benefits

  • Extensible without forking the project
  • Community ecosystem for sharing plugins
  • Maintainable - keeps core focused while enabling customization
  • Real-world use cases like Jira integration, Slack notifications, custom formatting

Implementation Status

This feature is fully implemented and includes:

  • Complete plugin system with manager and type definitions
  • Example Jira plugin demonstrating the concept
  • Comprehensive tests and documentation
  • Integration with existing configuration system

Ready for review and integration! 🚀

Additional information

  • Would you be willing to help implement this feature?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions