release-it-splunk-conf-bumper
v1.0.1
Published
A release-it plugin to bump Splunk configuration files
Readme
release-it-splunk-conf-bump
A release‑it plugin to bump Splunk
app.confversions and optional build numbers while preserving all original formatting.
Features
- Idempotent version updates in
[launcher]and[id]sections - Optional build‑number increment, configurable to run only when the version actually changes
- Preserves exact whitespace, comment placement, and EOL styles (
\nor\r\n) - Manifest support, optionally updates the version in app.manifest
- Dry‑run support: validates and logs without writing
- Simple, self‑contained, pure JavaScript – no binary dependencies
Installation
npm install --save-dev release-it-splunk-conf-bumperEnsure you have release‑it (v17+) installed:
npm install --save-dev release-itUsage
Add the plugin to your project’s .release-it.json or release-it.config.js:
{
"$schema": "https://unpkg.com/release-it@19/schema/release-it.json",
"git": {
"tagName": "v${version}",
"commitMessage": "chore(release): v${version}",
},
"npm": {
"publish": false,
},
"plugins": {
"release-it-splunk-conf-bumper": {
// app.conf support
"path": "app/default/app.conf",
// "paths": ["app1/default/app.conf", "app2/default/app.conf"],
// app.manifest support (opt-in)
"manifestPath": "app/app.manifest",
// "manifestPaths": ["app1/app.manifest", "app2/app.manifest"],
// build bump options (app.conf only)
"bumpBuild": {
"on": "prerelease", // default: "prerelease"
"onlyWhenVersionChanges": true,
},
},
},
}Then run:
# interactive bump
npx release-it
# CI mode, non-interactive
npx release-it --ci
# Dry‑run (validate without writing)
npx release-it --ci --dry-runPlugin Options
| Option | Type | Default | Description |
| ---------------------------------- | --------- | ------------ | ---------------------------------------------------------------------------------- |
| path | String | — | Path to a single app.conf. Mutually exclusive with paths. |
| paths | Array | — | Array of app.conf file paths to process. |
| manifestPath | String | — | Path to a single app.manifest. Mutually exclusive with manifestPaths. |
| manifestPaths | Array | — | Array of app.manifest file paths to process. |
| bumpBuild.on | String | prerelease | When to bump the build = counter: never, always, release, or prerelease. |
| bumpBuild.onlyWhenVersionChanges | Boolean | true | Only bump build if the version string actually changes. |
Example
app.conf
# app.conf before
[launcher]
version = 1.2.3
[id]
version = 1.2.3
[install]
# no build yetapp.manifest
{
"info": {
"id": {
"version": "1.2.3"
}
}
}Running
npx release-it --ci --no-npm --no-git.pushResults in:
[launcher]
version = 1.2.4
[id]
version = 1.2.4
[install]
build = 1And for manifest:
{
"info": {
"id": {
"version": "1.2.4"
}
}
}NOTES
When your app.conf is missing both [launcher] and [id] sections, the plugin will abort
immediately with an error — there’s nowhere for it to write a version. If at least
one of those sections exists but doesn’t contain a version = … line, you’ll get a
warning (not a hard failure), and the plugin will continue processing the other
section(s) or build bump as configured. This ensures you catch totally mis‑scoped
files early, while still allowing partial updates when only one of the two sections
needs a version update.
For manifest files, the plugin will update the nested info.id.version key. If that key is missing, a warning will be logged and the file will be skipped.
