1.1.0 • Published 4 years ago

@droplt/semantic-release-config v1.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Semantic-release shareable config for droplt.

Workflow

This shareable configuration use the conventional-changelog-conventionalcommits preset (conventional commits).

See the list of commits types and their impact on version bump, changelog generation and release trigger.

Commit TypeTrigger releaseVersion BumpChangelog SectionChangelog Visibility
buildpatch (v0.0.1)Build System
cipatch (v0.0.1)Continuous Integration
chore-Miscellaneous Chores
docs-Documentation
featminor (v0.1.0)Features
fixpatch (v0.0.1)Bug Fixes
perfpatch (v0.0.1)Performance Improvements
refactor-Code Refactoring
revert-Reverts
style-Styles
test-Tests

A special behavior for BREAKING CHANGE commits:

CommitTrigger releaseVersion BumpChangelog SectionChangelog Visibility
chore(scope)!: commit messagemajor (v1.0.0)⚠️ BREAKING CHANGES
perf(scope): commit messageBREAKING CHANGE: breaking messagemajor (v1.0.0)⚠️ BREAKING CHANGES

Plugins

This shareable configuration comes with the following plugins installed:

See each documentation for required installation and configuration steps.

Install

yarn add semantic-release @droplt/semantic-release-config -D

Usage

The shareable config can be configured via the semantic-release configuration file:

  • A .releaserc file, written in YAML or JSON, with optional extensions: .yaml/.yml/.json/.js
  • A release.config.js file that exports an object
  • A release key in the project's package.json file
// release.config.js
module.exports = {
  "extends": "@droplt/semantic-release-config"
}
// package.json
{
  ...
  "release": {
    "extends": "@droplt/semantic-release-config"
  }
}

Using a release.config.js allow you to customize the default configuration:

const config = require('@droplt/semantic-release-config')

module.exports = {
  ...config,
  plugins: [
    ...config.plugins,
    'add_your_plugin_here',
    ...
  ],
}

Examples

Run NPM script before release

Using the pre-installed @semantic-release/exec plugin, you can run a custom NPM script before the release process.

// release.config.js
const config = require('@droplt/semantic-release-config')

module.exports = {
  ...config,
  plugins: [
    ...config.plugins,
    ['@semantic-release/exec', {
      prepareCmd: 'yarn build',
    }],
  ],
}

Refer to @semantic-release/exec documentation for lifecycle hooks.