Skip to content

Latest commit

 

History

History
78 lines (54 loc) · 1.69 KB

File metadata and controls

78 lines (54 loc) · 1.69 KB

Publishing Guide

Pre-publishing Checklist

  1. Update package.json

    • Set correct author name: "author": "Your Name <your.email@example.com>"
    • Verify version number
    • Repository URLs are already configured ✅
  2. Test the library

    npm run build
  3. Create NPM account (if you don't have one)

Publishing Steps

1. Login to NPM

npm login

2. Check if package name is available

npm view use-shared-state

If this returns an error, the name is available!

3. Publish the package

npm publish

4. Verify publication

Post-publishing

  1. Add badges to README

    [![npm version](https://badge.fury.io/js/use-shared-state.svg)](https://badge.fury.io/js/use-shared-state)
    [![downloads](https://img.shields.io/npm/dm/use-shared-state.svg)](https://www.npmjs.com/package/use-shared-state)
  2. Optional: Set up GitHub repository

    • Create repository for source code
    • Add repository URLs to package.json later if needed

Updating the Package

  1. Make changes
  2. Update version (follow semantic versioning)
    npm version patch  # for bug fixes
    npm version minor  # for new features
    npm version major  # for breaking changes
  3. Build and publish
    npm run build
    npm publish

Ready to Publish!

Your package.json is already configured correctly. Just update the author name and you're ready to publish!