Skip to content

Commit a37ef03

Browse files
committed
docs: update CONTRIBUTING guide with changesets
1 parent 6ff3b60 commit a37ef03

File tree

1 file changed

+162
-0
lines changed

1 file changed

+162
-0
lines changed

CONTRIBUTING.md

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ This guide walks you through setting up the development environment and other im
2626
- [Option 2: Integrate into an existing sample](#option-2-integrate-into-an-existing-sample)
2727
- [Testing with AsgardeoProvider](#testing-with-asgardeoprovider)
2828
- [Update documentation](#update-documentation)
29+
- [Releases](#releases)
30+
- [Creating a Changeset](#creating-a-changeset)
31+
- [Step-by-step process](#step-by-step-process)
32+
- [For Maintainers](#for-maintainers)
33+
- [Release Process](#release-process)
34+
- [Release Automation](#release-automation)
2935
- [Contributing to the Documentation](#contributing-to-the-documentation)
3036

3137
## Prerequisite Software
@@ -319,6 +325,162 @@ For right-to-left languages, ensure that the UI layout adjusts correctly based o
319325

320326
Update any relevant documentation to mention the newly supported language.
321327

328+
### Releases
329+
330+
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.
331+
332+
#### Creating a Changeset
333+
334+
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.
335+
336+
**When do you need a changeset?**
337+
338+
- ✅ Adding new features
339+
- ✅ Fixing bugs
340+
- ✅ Making breaking changes
341+
- ✅ Performance improvements
342+
343+
**When you don't need a changeset?**
344+
345+
- ❌ Documentation-only changes
346+
- ❌ Internal refactoring that doesn't affect the public API
347+
- ❌ Test-only changes
348+
349+
##### Step-by-step process
350+
351+
1. **Run the changeset command** in your terminal from the root of the project:
352+
353+
```bash
354+
pnpm changeset
355+
```
356+
357+
2. **Select the packages** that your changes affect:
358+
359+
- Use the arrow keys to navigate through the list
360+
- Press space to select/deselect packages
361+
- Press Enter to confirm your selection
362+
363+
> [!IMPORTANT]
364+
> ⚠️ 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.
365+
366+
3. **Choose the type of change** for each selected package:
367+
368+
> [!IMPORTANT]
369+
> ⚠️ 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.
370+
371+
- **Patch** (0.0.X) - Bug fixes and non-breaking changes
372+
- **Minor** (0.X.0) - New features that don't break existing functionality
373+
- **Major** (X.0.0) - Breaking changes that require users to update their code
374+
375+
4. **Write a clear summary** of your changes:
376+
377+
- Use present tense (e.g., "Add new authentication method")
378+
- Be descriptive and user-focused
379+
- Mention any breaking changes clearly
380+
- Focus on what users will experience, not implementation details
381+
382+
5. **Commit the changeset file** along with your changes:
383+
384+
```bash
385+
git add .changeset/
386+
git commit -m "chore: add changeset 🦋"
387+
```
388+
389+
**Example changeset summary:**
390+
391+
````md
392+
---
393+
'@asgardeo/javascript': patch
394+
'@asgardeo/react': patch
395+
'@asgardeo/i18n': patch
396+
---
397+
398+
Update the react package to add a new `SignInWithPopup` method for popup-based authentication flows.
399+
400+
- This method allows users to sign in without redirecting, improving user experience.
401+
- Ensure to handle popup blockers and errors gracefully.
402+
403+
**Usage:**
404+
405+
```javascript
406+
import { SignInWithPopup } from '@asgardeo/react';
407+
408+
function App() {
409+
const handleSignIn = () => {
410+
SignInWithPopup()
411+
.then((user) => {
412+
console.log('User signed in:', user);
413+
})
414+
.catch((error) => {
415+
console.error('Error signing in:', error);
416+
});
417+
};
418+
419+
return (
420+
<div>
421+
<h1>Welcome to My App</h1>
422+
<button onClick={handleSignIn}>Sign In with Popup</button>
423+
</div>
424+
);
425+
}
426+
```
427+
428+
**Upgrade Notes:**
429+
430+
- Ensure your application can handle popup blockers.
431+
````
432+
433+
> [!TIP]
434+
> The changeset file will be automatically named and placed in the `.changeset/` directory. Don't edit these files manually after creation.
435+
436+
> [!IMPORTANT]
437+
> **Include your changeset in the same PR** as your code changes. PRs without changesets (when required) may be rejected during review.
438+
439+
#### For Maintainers
440+
441+
This section contains information relevant to project maintainers who handle the actual release process.
442+
443+
##### Release Process
444+
445+
The release process is fully automated and triggered by maintainers:
446+
447+
1. **Prerequisites for releases:**
448+
449+
- Maintainer permissions on the repository
450+
- NPM publish permissions for the `@asgardeo` organization
451+
- All PRs with changesets have been merged
452+
- Code review and testing completed
453+
454+
2. **Automatic release workflow:**
455+
456+
- When changesets are merged to `main`, a GitHub Action creates/updates a "Release" PR (ex: `[Release] [GitHub Action] Update package versions`).
457+
- The Release PR includes version bumps and generated changelogs
458+
- Maintainers review and merge the Release PR
459+
- Merging triggers automatic NPM publishing and GitHub releases
460+
461+
##### Release Automation
462+
463+
The project includes automated release infrastructure:
464+
465+
**GitHub Actions workflow** (`.github/workflows/release.yml`):
466+
467+
- Triggers on pushes to `main` branch
468+
- Creates release PRs using Changesets
469+
- Publishes packages to NPM when release PR is merged
470+
- Authenticates using `NPM_TOKEN` and `ASGARDEO_GITHUB_BOT_TOKEN` secrets
471+
472+
**Available scripts for maintainers:**
473+
474+
- `pnpm version:packages` - Updates versions and installs dependencies
475+
- `pnpm publish:packages` - Publishes all packages to NPM
476+
- `pnpm aggregate-changelogs` - Aggregates individual package changelogs
477+
478+
> [!IMPORTANT]
479+
> **Manual releases are strongly discouraged**. Always use the automated workflow to ensure consistency and prevent human errors.
480+
481+
> [!NOTE]
482+
> For pre-releases or special cases, use the `workflow_dispatch` trigger in the GitHub Actions workflow and coordinate with other maintainers.
483+
322484
### Contributing to the Documentation
323485

324486
The documentation for Asgardeo JavaScript SDKs is maintained in the Asgardeo / WSO2 Identity Server Official Docs site.

0 commit comments

Comments
 (0)