diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 39999223..9fc82cc3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,6 +26,12 @@ This guide walks you through setting up the development environment and other im - [Option 2: Integrate into an existing sample](#option-2-integrate-into-an-existing-sample) - [Testing with AsgardeoProvider](#testing-with-asgardeoprovider) - [Update documentation](#update-documentation) + - [Releases](#releases) + - [Creating a Changeset](#creating-a-changeset) + - [Step-by-step process](#step-by-step-process) + - [For Maintainers](#for-maintainers) + - [Release Process](#release-process) + - [Release Automation](#release-automation) - [Contributing to the Documentation](#contributing-to-the-documentation) ## Prerequisite Software @@ -319,6 +325,170 @@ For right-to-left languages, ensure that the UI layout adjusts correctly based o Update any relevant documentation to mention the newly supported language. +### Releases + +This project uses [🦋 Changesets](https://github.com/changesets/changesets) for version management and release automation. As an external contributor, you'll primarily interact with the changeset system when your changes need to be included in a release. + +#### Creating a Changeset + +Whenever you make changes that should be included in a release (new features, bug fixes, breaking changes), you must create a changeset. This helps maintainers understand what changed and how to version your contribution appropriately. + +**When do you need a changeset?** + +- ✅ Adding new features +- ✅ Fixing bugs +- ✅ Making breaking changes +- ✅ Performance improvements + +**When you don't need a changeset?** + +- ❌ Documentation-only changes +- ❌ Internal refactoring that doesn't affect the public API +- ❌ Test-only changes + +##### Step-by-step process + +1. **Run the changeset command** in your terminal from the root of the project: + +```bash +pnpm changeset +``` + +2. **Select the packages** that your changes affect: + + - Use the arrow keys to navigate through the list + - Press space to select/deselect packages + - Press Enter to confirm your selection + +> [!IMPORTANT] +> ⚠️ Pick only the packages that you have changed files in. If the package is used by different packages, those packages will automatically get a version bump if needed. + +3. **Choose the type of change** for each selected package: + +> [!IMPORTANT] +> ⚠️ Since we are still in the early stages of development, we are only doing **patch** releases for now. Please select "patch" for now until further notice. + +- **Patch** (0.0.X) - Bug fixes and non-breaking changes +- **Minor** (0.X.0) - New features that don't break existing functionality +- **Major** (X.0.0) - Breaking changes that require users to update their code + +4. **Write a clear summary** of your changes: + + - Use present tense (e.g., "Add new authentication method") + - Be descriptive and user-focused + - Mention any breaking changes clearly + - Focus on what users will experience, not implementation details + +5. **Commit the changeset file** along with your changes: + +```bash +git add .changeset/ +git commit -m "chore: add changeset 🦋" +``` + +**Example changeset summary:** + +> [!NOTE] +> This is an example changeset summary. +> Changes are made for: +> - `@asgardeo/javascript` +> - `@asgardeo/react` +> - `@asgardeo/i18n` +> Even though there are other packages depending on these, only include the packages you directly modified. + +````md +--- +'@asgardeo/javascript': patch +'@asgardeo/react': patch +'@asgardeo/i18n': patch +--- + +Update the react package to add a new `SignInWithPopup` method for popup-based authentication flows. + +- This method allows users to sign in without redirecting, improving user experience. +- Ensure to handle popup blockers and errors gracefully. + +**Usage:** + +```javascript +import { SignInWithPopup } from '@asgardeo/react'; + +function App() { + const handleSignIn = () => { + SignInWithPopup() + .then((user) => { + console.log('User signed in:', user); + }) + .catch((error) => { + console.error('Error signing in:', error); + }); + }; + + return ( +