Skip to content

[FEATURE]-Review .releaserc.json for improvements #34

@jkdevito

Description

@jkdevito
  1. Use the conventionalcommits preset — it's already being installed but not used. It's more configurable than the default angular preset and lets you control which commit types appear in release note
"preset": "conventionalcommits",
"presetConfig": {
  "types": [
    { "type": "feat", "section": "Features" },
    { "type": "fix", "section": "Bug Fixes" },
    { "type": "perf", "section": "Performance" },
    { "type": "revert", "section": "Reverts" },
    { "type": "refactor", "section": "Refactoring", "hidden": false },
    { "type": "chore", "hidden": true },
    { "type": "docs", "hidden": true },
    { "type": "style", "hidden": true },
    { "type": "ci", "hidden": true },
    { "type": "test", "hidden": true },
    { "type": "build", "hidden": true }
  ]
}
  1. Add force-minor and force-major release rules — you only have force-patch today.

  2. Add a changelogTitle for a cleaner CHANGELOG.md.

Full .releaserc.json file with updates (for reference)

{
  "plugins": [
    [
      "@semantic-release/commit-analyzer",
      {
        "preset": "conventionalcommits",
        "releaseRules": [
          { "type": "feat", "release": "minor" },
          { "type": "fix", "release": "patch" },
          { "type": "perf", "release": "patch" },
          { "type": "revert", "release": "patch" },
          { "scope": "force-patch", "release": "patch" },
          { "scope": "force-minor", "release": "minor" },
          { "scope": "force-major", "release": "major" },
          { "scope": "no-release", "release": false }
        ]
      }
    ],
    [
      "@semantic-release/release-notes-generator",
      {
        "preset": "conventionalcommits",
        "presetConfig": {
          "types": [
            { "type": "feat", "section": "Features" },
            { "type": "fix", "section": "Bug Fixes" },
            { "type": "perf", "section": "Performance" },
            { "type": "revert", "section": "Reverts" },
            { "type": "refactor", "section": "Refactoring", "hidden": false },
            { "type": "chore", "hidden": true },
            { "type": "docs", "hidden": true },
            { "type": "style", "hidden": true },
            { "type": "ci", "hidden": true },
            { "type": "test", "hidden": true },
            { "type": "build", "hidden": true }
          ]
        }
      }
    ],
    [
      "@semantic-release/changelog",
      {
        "changelogFile": "CHANGELOG.md",
        "changelogTitle": "# Changelog"
      }
    ],
    [
      "@semantic-release/exec",
      {
        "verifyReleaseCmd": "echo \"newVersion=true\" >> $GITHUB_OUTPUT",
        "publishCmd": "echo \"version=${nextRelease.version}\" >> $GITHUB_OUTPUT && echo \"tag=${nextRelease.gitTag}\" >> $GITHUB_OUTPUT && echo \"type=${nextRelease.type}\" >> $GITHUB_OUTPUT && echo \"channel=${nextRelease.channel}\" >> $GITHUB_OUTPUT"
      }
    ]
  ],
  "branches": [
    "main",
    {
      "name": "replace-me-feature-branch",
      "prerelease": "replace-me-prerelease",
      "channel": "replace-me-prerelease"
    }
  ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions