DEV Community

Visaka Devi
Visaka Devi

Posted on

1

publish a prerelease version of git your package

This guide outlines the steps to prepare, create, and publish a prerelease version of your package.

1. Preparing for Prerelease

Ensure all changes are committed before creating a prerelease version.

git add .
git commit -m "chore: prepare for new prerelease version"
Enter fullscreen mode Exit fullscreen mode

2. Creating the Prerelease Version

Use npm version to create a prerelease version with a specified identifier:

npm version prerelease --preid=your-feature-name
Enter fullscreen mode Exit fullscreen mode

This command will:

  • Increment the patch version.
  • Add the prerelease identifier (your-feature-name).
  • Create a new git commit with the updated version.
  • Create a new git tag for the version.
  • Update the package.json file with the new version.

3. Building the Project

Before publishing, ensure the project is built properly:

npm run build
Enter fullscreen mode Exit fullscreen mode

4. Publishing the Prerelease Version

Publish the prerelease version to npm with a specific tag:

npm publish --tag your-feature-name
Enter fullscreen mode Exit fullscreen mode

This ensures:

  • The package is published with the specified prerelease tag.
  • Users can install the prerelease version without affecting the latest stable release.

5. Installing a Prerelease Version

To install the prerelease version of the package, use:

npm install your-package-name@your-feature-name
Enter fullscreen mode Exit fullscreen mode

This allows testing of the prerelease version before merging it into the stable release.

Heroku

Deliver your unique apps, your own way.

Heroku tackles the toil — patching and upgrading, 24/7 ops and security, build systems, failovers, and more. Stay focused on building great data-driven applications.

Learn More

Top comments (0)

👋 Kindness is contagious

Explore this insightful post in the vibrant DEV Community. Developers from all walks of life are invited to contribute and elevate our shared know-how.

A simple "thank you" could lift spirits—leave your kudos in the comments!

On DEV, passing on wisdom paves our way and unites us. Enjoyed this piece? A brief note of thanks to the writer goes a long way.

Okay