|
| 1 | +# Release Process |
| 2 | + |
| 3 | +This document describes how to create a new release of the `react-native-leaflet-view` package. |
| 4 | + |
| 5 | +## Preparation |
| 6 | + |
| 7 | +1. Make sure all your changes are committed and pushed to the main branch. |
| 8 | +2. Pull the latest changes from the main branch: |
| 9 | + ``` |
| 10 | + git checkout main |
| 11 | + git pull origin main |
| 12 | + ``` |
| 13 | + |
| 14 | +3. Fix any linting issues: |
| 15 | + ``` |
| 16 | + yarn lint --fix |
| 17 | + ``` |
| 18 | + |
| 19 | +## Release Process |
| 20 | + |
| 21 | +There are two ways to create a release: |
| 22 | + |
| 23 | +### Using release-it (automated way) |
| 24 | + |
| 25 | +1. Make sure you're logged in to npm: |
| 26 | + ``` |
| 27 | + npm login |
| 28 | + ``` |
| 29 | + |
| 30 | +2. Run the release command: |
| 31 | + ``` |
| 32 | + yarn release |
| 33 | + ``` |
| 34 | + |
| 35 | + This will: |
| 36 | + - Prompt you for the new version (patch, minor, major) |
| 37 | + - Update the version in package.json |
| 38 | + - Create a git commit with the version change |
| 39 | + - Create a git tag |
| 40 | + - Push the changes and tag to GitHub |
| 41 | + - Publish the package to npm |
| 42 | + - Create a GitHub release |
| 43 | + |
| 44 | +3. If you want to specify the version type: |
| 45 | + ``` |
| 46 | + yarn release patch # For bug fixes (1.0.0 -> 1.0.1) |
| 47 | + yarn release minor # For new features (1.0.0 -> 1.1.0) |
| 48 | + yarn release major # For breaking changes (1.0.0 -> 2.0.0) |
| 49 | + ``` |
| 50 | + |
| 51 | +### Manual Release Process |
| 52 | + |
| 53 | +If you prefer more control over the process, follow these steps: |
| 54 | + |
| 55 | +1. Make sure you're logged in to npm: |
| 56 | + ``` |
| 57 | + npm login |
| 58 | + ``` |
| 59 | + |
| 60 | +2. Update the version in package.json using npm (this also creates a git tag): |
| 61 | + ``` |
| 62 | + npm version patch # For bug fixes (1.0.0 -> 1.0.1) |
| 63 | + npm version minor # For new features (1.0.0 -> 1.1.0) |
| 64 | + npm version major # For breaking changes (1.0.0 -> 2.0.0) |
| 65 | + ``` |
| 66 | + |
| 67 | + Or manually edit package.json and create a tag: |
| 68 | + ``` |
| 69 | + # After editing package.json |
| 70 | + git add package.json |
| 71 | + git commit -m "chore: bump version to X.Y.Z" |
| 72 | + git tag -a vX.Y.Z -m "Version X.Y.Z" |
| 73 | + ``` |
| 74 | + |
| 75 | +3. Push the changes and tags to GitHub: |
| 76 | + ``` |
| 77 | + git push origin main --tags |
| 78 | + ``` |
| 79 | + |
| 80 | +4. Build and publish the package to npm: |
| 81 | + ``` |
| 82 | + npm publish |
| 83 | + ``` |
| 84 | + |
| 85 | +5. Create a GitHub release (either through the GitHub web interface or using the GitHub CLI): |
| 86 | + ``` |
| 87 | + gh release create vX.Y.Z --title "Version X.Y.Z" --notes "Release notes here" |
| 88 | + ``` |
| 89 | + |
| 90 | +## Troubleshooting |
| 91 | + |
| 92 | +### Version already exists on npm |
| 93 | + |
| 94 | +npm doesn't allow publishing the same version twice. If a version already exists, you'll need to increment to a new version. |
| 95 | + |
| 96 | +To check currently published versions: |
| 97 | +``` |
| 98 | +npm view react-native-leaflet-view versions |
| 99 | +``` |
| 100 | + |
| 101 | +### Linting issues |
| 102 | + |
| 103 | +If there are linting issues preventing the commit, fix them: |
| 104 | +``` |
| 105 | +yarn lint --fix |
| 106 | +``` |
| 107 | + |
| 108 | +Or for specific files: |
| 109 | +``` |
| 110 | +yarn eslint "src/LeafletView/index.tsx" --fix |
| 111 | +``` |
| 112 | + |
| 113 | +## Notes |
| 114 | + |
| 115 | +- Once a version is published to npm, it cannot be removed or republished with the same version number. |
| 116 | +- Make sure to update the README.md if there are significant changes in the new release. |
| 117 | +- Consider updating the example app to showcase new features. |
0 commit comments