{"id":13565700,"url":"https://github.com/release-it/bumper","last_synced_at":"2025-04-04T18:04:22.567Z","repository":{"id":44952302,"uuid":"184619160","full_name":"release-it/bumper","owner":"release-it","description":"Version read/write plugin for release-it","archived":false,"fork":false,"pushed_at":"2025-03-13T06:19:58.000Z","size":60,"stargazers_count":37,"open_issues_count":3,"forks_count":17,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T17:08:17.470Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/release-it.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-02T16:59:49.000Z","updated_at":"2025-03-13T10:46:50.000Z","dependencies_parsed_at":"2024-08-01T13:22:34.177Z","dependency_job_id":"ce4b4f70-6c39-4bed-86de-9e7fb05d6b08","html_url":"https://github.com/release-it/bumper","commit_stats":{"total_commits":69,"total_committers":5,"mean_commits":13.8,"dds":"0.10144927536231885","last_synced_commit":"183aae7f49578da96daadd92f2b3bc9a78f606ce"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/release-it%2Fbumper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/release-it%2Fbumper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/release-it%2Fbumper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/release-it%2Fbumper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/release-it","download_url":"https://codeload.github.com/release-it/bumper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247226213,"owners_count":20904465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:01:53.299Z","updated_at":"2025-04-04T18:04:22.546Z","avatar_url":"https://github.com/release-it.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Version read/write plugin for release-it\n\nThis plugin reads and/or writes version/manifest files.\n\n```sh\nnpm install --save-dev @release-it/bumper\n```\n\nIn [release-it][1] config:\n\n```json\n\"plugins\": {\n  \"@release-it/bumper\": {\n    \"in\": \"composer.json\",\n    \"out\": \"composer.json\",\n  }\n}\n```\n\n- Use only the `in` option to _read_ the version from this file in the release-it process.\n- Use only the `out` option to _write_ the version that was determined by release-it to this file.\n- Use both to read _and_ write the `version` property from/to this file.\n\nThe `version` from the `in` file will take precedence over the latest Git tag (and the `version` from `package.json` if\nit exists) in release-it to determine the latest version.\n\nNote that using `package.json` as `out` file may conflict with the npm plugin in release-it. Remove it from the `out`\nfile(s), or use [`--npm.allowSameVersion`][2].\n\nThe supported file types are:\n\n| Type | Extension(s)      | Mime-type                                                 |\n| ---- | ----------------- | --------------------------------------------------------- |\n| JSON | `.json`           | `application/json`                                        |\n| YAML | `.yaml` or `.yml` | `text/yaml` or `application-x-yaml` or `application/yaml` |\n| TOML | `.toml`           | `text/toml` or `application/toml`                         |\n| INI  | `.ini`            | `text/x-properties`                                       |\n| XML  | `.xml`            | `text/xml` or `application/xml`                           |\n| HTML | `.html`           | `text/html` or `application/xhtml+xml`                    |\n| TEXT | `.txt`            | `text/*`                                                  |\n\nExplicitly providing the (mime) `type` takes precedence over the file extension.\n\nThe fallback type is `text` if the file extension and/or `type` is not known (e.g. `index.php`).\n\n```json\n\"plugins\": {\n  \"@release-it/bumper\": {\n    \"in\": {\n      \"file\": \"VERSION\",\n      \"type\": \"text/plain\"\n    },\n    \"out\": {\n      \"file\": \"VERSION\",\n      \"type\": \"text/plain\"\n    }\n  }\n}\n```\n\nTo replace all occurences of the current version with the new version in any text file:\n\n```json\n\"plugins\": {\n  \"@release-it/bumper\": {\n    \"out\": {\n      \"file\": \"file.php\",\n      \"type\": \"text/php\"\n    }\n  }\n}\n```\n\n\\:warning: the operation is a search-and-replace; if the current version is not found in the file, the new version\ncannot be written out.\n\nTo instead always consume the entire file, that is, the whole and only content of the file is the version number, set\n`consumeWholeFile: true` for the `out` option:\n\n```json\n\"plugins\": {\n  \"@release-it/bumper\": {\n    \"out\": {\n      \"file\": \"VERSION\",\n      \"type\": \"text/plain\",\n      \"consumeWholeFile\": true\n    }\n  }\n}\n```\n\nThe version number is then written to the output file, overwriting it completely instead of a search-and-replace.\n\n\\:bulb: Setting `consumeWholeFile: true` precludes the use of prefixes, such as `v1.0.1` in the output file.\n\nThe `out` option can also be an array of files:\n\n```json\n\"plugins\": {\n  \"@release-it/bumper\": {\n    \"out\": [\"manifest.json\", \"bower.json\"]\n  }\n}\n```\n\nThe `out` option is parsed with [fast-glob][3], so glob patterns can be used to match files to write to:\n\n```json\n\"plugins\": {\n  \"@release-it/bumper\": {\n    \"out\": \"dist/*.json\"\n  }\n}\n```\n\nThe `path` option (default: `\"version\"`) can be used to change a different property. The following example will set the\n`current.version` property to the new version in `manifest.json`:\n\n```json\n\"plugins\": {\n  \"@release-it/bumper\": {\n    \"out\": {\n      \"file\": \"manifest.json\",\n      \"path\": \"current.version\"\n    }\n  }\n}\n```\n\n\u003e For the `xml` type, the `path` option must be in the form of a unique [css selector][4]. The following example will\n\u003e set the `project \u003e version` property to the new version in `pom.xml`:\n\n```json\n\"plugins\": {\n  \"@release-it/bumper\": {\n    \"out\": {\n      \"file\": \"pom.xml\",\n      \"path\": \"project \u003e version\",\n      \"type\": \"application/xml\"\n    }\n  }\n}\n```\n\nFor the `html` type, the `path` option must be in the form of a unique [css selector][4]. The following example will set\nthe element text content with the css attribute `#version` to the new version in `foo.html`:\n\n```json\n\"plugins\": {\n  \"@release-it/bumper\": {\n    \"out\": {\n      \"file\": \"foo.html\",\n      \"path\": \"#version\",\n      \"type\": \"text/html\"\n    }\n  }\n}\n```\n\nMultiple paths can be provided using an array.\n\nThe `versionPrefix` option (default: `''`) can be used in cases where you'd like to maintain a specific prefix for your\nversion number (for example, in `package.json` where you might want versions like `^1.0.0`). This will prepend the\nspecified prefix to the bumped version:\n\n```json\n\"plugins\": {\n  \"@release-it/bumper\": {\n    \"out\": {\n      \"file\": \"package.json\",\n      \"path\": \"version\",\n      \"prefix\": \"^\"\n    }\n  }\n}\n```\n\nWith the above configuration, if release-it determines the new version to be `1.0.0`, it'll be saved as `^1.0.0` in the\ntargeted file.\n\n## Command-line\n\nOptions for this plugin can be set from the command line. Some examples:\n\n```\nrelease-it --plugins.@release-it/bumper.in=composer.json\nrelease-it --plugins.@release-it/bumper.out=composer.json --plugins.@release-it/bumper.out=manifest.json\n```\n\n- Keys are separated by dots.\n- Values can be negated by prefixing the key with `no-`.\n- Arguments may need to be single-quoted (`'`) such as `--'deep.key=value'` or `'--deep.key=value'`\n\nDepending on your shell or OS this may differ.\n\n[1]: https://github.com/release-it/release-it\n[2]: https://github.com/release-it/release-it/blob/master/docs/npm.md#extra-arguments\n[3]: https://github.com/mrmlnc/fast-glob\n[4]: https://www.w3.org/TR/selectors-4/#overview\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frelease-it%2Fbumper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frelease-it%2Fbumper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frelease-it%2Fbumper/lists"}