1.5.1 • Published 6 months ago

semver-auto v1.5.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Semver auto in progress

Installation And Usage

npm install semver-auto --save-dev
npx semver-auto

Overview

This script addresses a common challenge in private* projects related to package versioning, specifically the absence of Semantic Versioning (also called SemVer). It is designed as a targeted response to enhancing the versioning process and overcome issues such as the default version that often arises during development. By automating version updates based on dependency changes, it not only simplifies the development process but also ensures that version numbers accurately represent the changes in project packages.

Change-Driven Versioning: The script intelligently determines the appropriate version change (major, minor, or patch) based on the nature of the changes in the dependencies. This makes versioning more reflective of the impact of updates on the project. It currently examines dependencies, devDependencies, and optionalDependencies within the package.json.

Code statusStageRuleExample version
First release of package.jsonNew productStart with 1.0.01.0.0
Dependency that are backward compatible bug fixPatch releaseIncrement the third digit1.0.1
Dependency that are backward compatible new featureMinor releaseIncrement the middle digit and reset last digit to zero1.1.0
Dependency change that break backward compatibilityMajor releaseIncrement the first digit and reset middle and last digits to zero2.0.0

* A private Node.js project can set the "private" attribute in its package.json to true, see reference.

Options

File Location

By default, the script assumes the package.json file is located in the folder you are in. To specify a different location, utilize the -f or --file flag, indicating the path to your package.json. For example:

npx semver-auto --file <my-path/package.json>

Logging

Enhance logging capabilities with detailed insights by enabling verbose mode using the -l or --log flag. For example: f

npx semver-auto --log

Progress Bar

Enable a progress bar with the -p or --progress flag. For example:

npx semver-auto --progress

HEAD Start

In Git, "HEAD" refers to the most recent commit on the currently checked-out branch. If you've previously run semver-auto, reanalyzing all commits to determine the appropriate version may be redundant. In these cases, you can start the analysis from the latest commit on your branch to make execution faster. However, exercise caution when doing so. Enable this feature by including the -h or --head flag. For example:

npx semver-auto --head

Exiting

The script can exit with a non-zero code, signaling the need for execution before proceeding with CI/CD steps. Enable by using the -e or --exit flag. For example:

npx semver-auto --exit

Upcoming Features

  • Include the -h and --help flags.
  • Update project architecture.
  • Unit Testing integration for script reliability.
  • Incorporate flag-based logic into a dedicated file to optimize performance during regular execution.

Disclaimer

This project may not be suitable If you plan to publish your package, see reference. The most important things in your package.json are the name and version fields as they will be required.

Contributing

Contributions are welcome! If you encounter issues or have suggestions for improvement, please open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

1.5.1

6 months ago

1.5.0

6 months ago

1.4.10

6 months ago

1.4.9

6 months ago

1.4.8

6 months ago

1.4.7

6 months ago

1.4.6

6 months ago

1.4.5

6 months ago

1.4.4

6 months ago

1.4.3

6 months ago

1.4.2

6 months ago

1.4.1

6 months ago

1.4.0

6 months ago

1.3.7

6 months ago

1.3.6

6 months ago

1.3.5

6 months ago

1.3.4

6 months ago

1.3.3

6 months ago

1.3.2

6 months ago

1.3.1

6 months ago

1.3.0

6 months ago

1.2.12

6 months ago

1.2.5

6 months ago

1.2.4

6 months ago

1.2.3

6 months ago

1.2.2

6 months ago

1.2.1

6 months ago

1.2.0

6 months ago

1.1.6

6 months ago

1.1.5

6 months ago

1.1.4

6 months ago

1.1.3

6 months ago

1.1.2

6 months ago

1.1.1

6 months ago

1.1.0

6 months ago

1.0.11

6 months ago

1.0.10

6 months ago

1.0.9

6 months ago

1.0.8

6 months ago

1.0.7

6 months ago

1.0.6

6 months ago

1.0.5

6 months ago

3.0.0

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago