@muraldevkit/ds-semrel-config

1.1.0 • Public • Published

Mural Design System Semantic Release Configuration

We use Semantic Release for version management and the package release workflow. This package contains the configuration files required by Semantic Release.

Table of Contents

  1. How to release a new package
    1. Running releases locally
  2. Plugin configuration
    1. @semantic-release/commit-analyzer
  3. Testing

How to release a new package

If you want to use this configuration to release a new package within the design system, please follow these steps:

  1. In the new package that you want to release, update package.json devDependencies by manually adding the packages below. Because we need to use * instead of a version number, please don't use npm install.
    "devDependencies": {
    	"@muraldevkit/ds-semrel-config": "*",
    	"@muraldevkit/ds-semrel-manager": "*",
    	"@muraldevkit/ds-semrel-stencil-exports": "*",
    }
  2. Run npm install from the root of the monorepo.
  3. Create a release configuration file within the config folder of your package named release.config.js. You may need to create the folder if it does not already exist. The file should contain the following content:
    /* eslint-disable @typescript-eslint/no-var-requires */
    'use strict';
    
    const releaseConfig = require('@muraldevkit/ds-semrel-config');
    
    module.exports = releaseConfig;
  4. Set up the package.json file:
    • Add a new release object that extends the semantic-release-monorepo package and our newly-created local configuration (described in the previous step).
       "release": {
       	"extends": [
       		"semantic-release-monorepo",
       		"./config/release.config"
       	]
       }
    • Update the scripts object with a consistently-named command that can be executed within the monorepo's workflow.
       "release": "npx semantic-release"
  5. Set up the monorepo root to execute a release across all packages (assuming you are using Lerna):
    "release": "npx lerna run release --concurrency 1 --stream",

Skip this step if that script already exists

Running releases locally

To run the script locally, the branch you are attempting to release must be pushed to the repository first. Once that is done, use:

npm run release

Plugin configuration

In some cases, the plugins called by Semantic Release use custom functions or configuration:

@semantic-release/commit-analyzer

The Semantic Release Commit Analyzer looks at each commit found since the last release and determines if it should trigger a new release and what the release type should be (major, minor, or patch).

The rules used by the plugin are customized by passing a releaseRules array as part of the plugin's configuration object. The design system uses a custom function which takes a configuration object and generates the releaseRules array. The default configuration object is located in config/default-rules.js.

Testing

Jest unit tests can be run within the package directory using:

npm run test

Test files are located in the tests directory and new files should follow the naming convention <scriptToTest>.test.ts.

Readme

Keywords

none

Package Sidebar

Install

npm i @muraldevkit/ds-semrel-config

Weekly Downloads

0

Version

1.1.0

License

https://www.mural.co/terms/developer-addendum

Unpacked Size

9.01 kB

Total Files

8

Last publish

Collaborators

  • mural-devvel
  • muralco