DEV Community

Visaka Devi
Visaka Devi

Posted on

2 1 1 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.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay