semantic-release-verify-deps

verify dependencies plugin for semantic-release

Usage no npm install needed!

<script type="module">
  import semanticReleaseVerifyDeps from 'https://cdn.skypack.dev/semantic-release-verify-deps';
</script>

README

Semantic-release-verify-deps

semantic-release plugin to validate the format of dependencies before releasing.

Why create this plugin

In the typical gitflow process, we release tags on master branch and we implement on develop branch.

When doing implementation we sometimes need to change deps to 'floating' deps like :

Even if this is useful on dev branch, it is a bad idea to release on master branch a version with floating dependencies.

Current plugin lets you define a validation/regular expression pattern to avoid this kind of mistake.

Installation

npm install --save-dev semantic-release-verify-deps 

Usage

Plugin must be set within the plugin definition in the Semantic-release configuration file on Verify Conditions step in the project's package.json file.

For example, you can force each dependency to finish with a digit in package.json by doing :

"release": {
    "verifyConditions": [
      {
        "path": "semantic-release-verify-deps",
        "dependencies": true,
        "devDependencies": false,
        "regExps": [
          "\\Dquot;
        ]
      }
    ]

Configuration

Parameters:

Parameter Description Type Default
dependencies dependencies that are specified in package.json file boolean true
devDependencies dependencies that are specified in package.json file boolean false
regExps regular expresions that will be used as pattern in RegExp Constructor to match invalid dependencies in package.json file array of patterns []

Regexps examples

"\\Dquot; : Each dependency ending without a digit is invalid for release

"\\dquot; : Each dependency ending with a digit is invalid for release

".*github.*" : Each github dependency is invalid for release