The `dev-build-release` package is a suite of command-line tools designed to automate versioning for development and feature branch releases within JavaScript/TypeScript projects. Its primary utility, `dev-build-release`, modifies the `package.json` version string by appending build numbers and branch names, following a structured schema (e.g., `1.0.0-feat-branch.123`). This functionality is essential for maintaining distinct pre-release versions in continuous integration and delivery (CI/CD) environments. The package also includes `determine-version`, which assists in identifying downstream dependent repositories that may require updates based on the current project's version, and `generate-version-file`, a tool that creates a `version.json` file containing detailed build information derived from `package.json` and, optionally, CI variables from systems like Jenkins or GitLab. Currently at version `0.1.6`, the project demonstrates a moderate release cadence, focusing on compatibility fixes, such as adapting to older JavaScript engines by internally replacing `replaceAll` with `replace`, and enhancing integration with diverse CI systems. Its key differentiator is its ability to streamline the often-complex process of consistent development versioning, removing the need for manual intervention and proving particularly valuable for workflows that rely heavily on feature branches.
npm install dev-build-releaseVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates installing `dev-build-release` as a dev dependency and shows how to use its main CLI commands: `dev-build-release` for modifying `package.json` version, and `generate-version-file` via an npm script to create a `version.json` artifact.
Update any CI/CD scripts, build processes, or dependent consumers that parse the version string to expect the new `feat-newFeature` hyphenated format for branch names.
Ensure your Node.js environment is compatible with the package's requirements. This change specifically broadens compatibility, so users on older Node.js versions might find previous issues resolved.
Review your CI/CD configuration to ensure that the correct environment variables (Jenkins or GitLab) are exposed and named appropriately for `generate-version-file` to pick up the desired build information.
To run directly, use `npx dev-build-release ...`. If using within npm scripts, ensure the script references `node ./node_modules/dev-build-release/bin/dev-build-release` or relies on `node_modules/.bin` being in the PATH (which npm handles for scripts).
Navigate to the root directory of your project where `package.json` is located before running any `dev-build-release` commands.
Adjust any scripts or logic that consume the generated version string to expect hyphens (`-`) instead of forward slashes (`/`) in the branch name segment (e.g., `feat-myFeature` instead of `feat/myFeature`).