# @google/semantic-release-replace-plugin

> Semantic Release Replace Plugin

Latest version **1.2.7** (published 2023-07-20) · Apache-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @google/semantic-release-replace-plugin
pnpm add @google/semantic-release-replace-plugin
yarn add @google/semantic-release-replace-plugin
bun add @google/semantic-release-replace-plugin
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.2.7 |
| Published | 2023-07-20 |
| First published | 2020-03-30 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18 |
| Dependencies | 3 |
| Unpacked size | 34.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 115 |
| Author | Justin Poehnelt |
| Maintainers | bcoe, google-wombot, ofrobots, mrdoob |
| Keywords | semantic-release, node, replace |

## Links

- npm: https://www.npmjs.com/package/@google/semantic-release-replace-plugin
- Repository: https://github.com/jpoehnelt/semantic-release-replace-plugin
- Homepage: https://github.com/jpoehnelt/semantic-release-replace-plugin#readme
- Issues: https://github.com/jpoehnelt/semantic-release-replace-plugin/issues
- npm.io page: https://npm.io/package/@google/semantic-release-replace-plugin

## Dependencies (3)

- [jest-diff](https://npm.io/package/jest-diff.md) ^29.6.0
- [lodash-es](https://npm.io/package/lodash-es.md) ^4.17.21
- [replace-in-file](https://npm.io/package/replace-in-file.md) ^7.0.1

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.2.7 (latest) — 2023-07-20
- 1.2.5 — 2023-07-06
- 1.2.4 — 2023-07-06
- 1.2.1 — 2023-07-06
- 1.2.0 — 2022-12-20
- 1.1.0 — 2021-08-30
- 1.0.2 — 2020-10-08
- 1.0.1 — 2020-09-23
- 1.0.0 — 2020-03-30
- 1.0.0-alpha.1 — 2020-03-30
- 1.0.0-alpha.0 — 2020-03-30

## README

# Semantic Release Replace Plugin

[![npm](https://img.shields.io/npm/v/semantic-release-replace-plugin)](https://www.npmjs.com/package/semantic-release-replace-plugin)
![Build](https://github.com/jpoehnelt/semantic-release-replace-plugin/workflows/Build/badge.svg)
![Release](https://github.com/jpoehnelt/semantic-release-replace-plugin/workflows/Release/badge.svg)
[![codecov](https://codecov.io/gh/jpoehnelt/semantic-release-replace-plugin/branch/master/graph/badge.svg)](https://codecov.io/gh/jpoehnelt/semantic-release-replace-plugin)
![GitHub contributors](https://img.shields.io/github/contributors/jpoehnelt/semantic-release-replace-plugin?color=green)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

The `semantic-release-replace-plugin` plugin provides functionality to update version strings throughout a project. This enables semantic release to be used in many different languages and build processes.

Read more about [Semantic Release](https://semantic-release.gitbook.io/).

## Install

```bash
$ npm install semantic-release-replace-plugin -D
```

## Usage

The following example uses this plugin to demonstrate using semantic-release in a Python package where `__VERSION__` is defined in the root `__init__.py` file.

```json
{
  "plugins": [
    "@semantic-release/commit-analyzer",
    [
      "semantic-release-replace-plugin",
      {
        "replacements": [
          {
            "files": ["foo/__init__.py"],
            "from": "__VERSION__ = \".*\"",
            "to": "__VERSION__ = \"${nextRelease.version}\"",
            "results": [
              {
                "file": "foo/__init__.py",
                "hasChanged": true,
                "numMatches": 1,
                "numReplacements": 1
              }
            ],
            "countMatches": true
          }
        ]
      }
    ],
    [
      "@semantic-release/git",
      {
        "assets": ["foo/*.py"]
      }
    ]
  ]
}
```
### Validation

The presence of the `results` array will trigger validation that a replacement has been made. This is optional but recommended.

### Warning

This plugin will not commit changes unless you specify assets for the @semantic-release/git plugin! This is highlighted below.

```
[
  "@semantic-release/git",
  {
    "assets": ["foo/*.py"]
  }
]
```

## Options

Please refer to the [documentation](./docs/README.md) for more options.

---
_Source: https://npm.io/package/@google/semantic-release-replace-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
