Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
15 changes: 15 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": [],
"privatePackages": {
"version": false,
"tag": false
}
}
5 changes: 5 additions & 0 deletions .changeset/tangy-pens-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lifi/widget": patch
---

Replace lerna and standard-version with changesets
59 changes: 59 additions & 0 deletions .github/RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Releasing

This document describes the release process for the LI.FI Widget packages.

## Overview

The project uses [Changesets](https://github.com/changesets/changesets) to manage versioning and releases. The release process is automated through GitHub Actions workflows.

## Release Process

### 1. Creating Changesets

When making changes that affect package versions, contributors need to create a changeset:

1. Run `pnpm changeset` to create a new changeset file
2. Select the packages affected by your changes
3. Choose the version bump type (patch, minor, or major)
4. Write a description of your changes
5. Commit the changeset file along with your changes

Changesets accumulate in the `.changeset/` directory and can be batched together before versioning.

### 2. Automated Version PR Creation

When changesets are merged to `main`, the versioning process is automated:

1. The "Changesets" workflow automatically runs on every push to `main`
2. If there are pending changesets, it creates a "Version Packages" PR with all accumulated changesets
3. Review and merge the version PR to bump versions and update changelogs
4. After merging, create and push a git tag matching the new version (e.g., `v3.34.2`)
5. Pushing the tag will automatically trigger the publish workflow to build and publish packages to npm

This allows multiple changes to be batched into a single release version. The workflow only creates a version PR when there are pending changesets, so it won't create empty PRs if no changesets exist.

### 3. Publishing

After the version PR is merged and a git tag is pushed:

- The `publish.yaml` workflow automatically triggers
- Packages are built and published to npm
- A GitHub Release is created automatically
- For alpha/beta tags, packages are published with the corresponding npm tag

## Manual Release Commands

If you need to manually trigger parts of the release process:

- `pnpm release:version` - Bump versions and update changelogs
- `pnpm release:build` - Build all packages
- `pnpm release:publish` - Build and publish to npm (requires NPM_TOKEN)
- `pnpm release:publish:alpha` - Publish alpha snapshot release
- `pnpm release:publish:beta` - Publish beta snapshot release

## Workflow Files

- `.github/workflows/changesets.yml` - Automatically creates version PRs on push to main
- `.github/workflows/publish.yaml` - Publishes packages when git tags are pushed
- `.github/workflows/changeset-check.yml` - Validates that PRs include changesets

43 changes: 43 additions & 0 deletions .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Changesets

on:
push:
branches: [main]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
changesets:
name: Create Version PR
# prevents this action from running on forks
if: github.repository == 'lifinance/widget'
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Clone repository
uses: actions/checkout@v4
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Install dependencies
uses: ./.github/actions/pnpm-install

- name: Create Version PR
uses: changesets/action@v1
with:
title: 'chore: version packages'
commit: 'chore: version packages'
version: pnpm release:version && pnpm release:build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

7 changes: 5 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release & Publish Beta
name: Release & Publish

on:
push:
Expand All @@ -16,6 +16,9 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
env:
Expand All @@ -24,7 +27,7 @@ jobs:
generate_release_notes: true
name: ${{ github.ref_name }}
draft: false
prerelease: false
prerelease: ${{ contains(github.ref_name, 'alpha') || contains(github.ref_name, 'beta') }}

publish:
permissions:
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,24 @@ If you'd like to contribute translations, please visit our Crowdin project page

Thank you for your support!

## Contributing

### Adding Changesets

When making changes that affect package versions, you need to create a changeset:

1. Run `pnpm changeset` to create a new changeset file
2. Select the packages affected by your changes
3. Choose the version bump type (patch, minor, or major)
4. Write a description of your changes
5. Commit the changeset file along with your changes

Changesets accumulate in the `.changeset/` directory and can be batched together before versioning.

### Release Process

The release process is automated using [Changesets](https://github.com/changesets/changesets). For detailed information about the release workflow, see [RELEASING.md](.github/RELEASING.md).

## Changelog

The [changelog](/CHANGELOG.md) is regularly updated to reflect what's changed in each new release.
13 changes: 0 additions & 13 deletions lerna.json

This file was deleted.

23 changes: 9 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
"clean:modules:trash": "find . -name \"node_modules\" -type d -prune -exec trash {} +",
"dev": "pnpm --filter widget-playground-vite dev",
"dev:next": "pnpm --filter widget-playground-next dev",
"release": "pnpm release:version && pnpm release:build && pnpm standard-version -a -s",
"release:alpha": "pnpm release:version --preid alpha && pnpm release:build && pnpm standard-version -a -s --prerelease alpha --skip.changelog",
"release:beta": "pnpm release:version --preid beta && pnpm release:build && pnpm standard-version -a -s --prerelease beta --skip.changelog",
"release:version": "lerna version --no-changelog --no-push --no-git-tag-version --no-private",
"release": "pnpm release:version && pnpm release:build",
"release:alpha": "pnpm release:version --snapshot alpha && pnpm release:build",
"release:beta": "pnpm release:version --snapshot beta && pnpm release:build",
"release:version": "changeset version",
"release:build": "pnpm -r --parallel release:build",
"release:publish:build": "pnpm release:build && pnpm -r --parallel build:prerelease",
"release:publish": "pnpm release:publish:build && pnpm -r publish --access public --no-git-checks --tag latest && pnpm release:clean",
"release:publish": "pnpm release:publish:build && changeset publish && pnpm release:clean",
"release:publish:alpha": "pnpm release:publish:build && pnpm -r publish --access public --no-git-checks --tag alpha && pnpm release:clean",
"release:publish:beta": "pnpm release:publish:build && pnpm -r publish --access public --no-git-checks --tag beta && pnpm release:clean",
"release:clean": "pnpm -r --parallel --filter './packages/**' --filter '!*-playground-*' --filter '!*-embedded' exec sh -c \"node ../../scripts/postrelease.js && rm -rf *.md\"",
Expand All @@ -35,22 +35,19 @@
"postinstall": "husky",
"knip:all": "knip",
"knip:check": "knip --dependencies --files --no-config-hints --exclude binaries",
"knip:write": "pnpm knip:check --fix"
"knip:write": "pnpm knip:check --fix",
"changeset": "changeset",
"changeset:status": "changeset status"
},
"lint-staged": {
"*": [
"pnpm pre-commit",
"bash -c 'pnpm knip:check'"
]
},
"standard-version": {
"scripts": {
"prerelease": "pnpm install && git add .",
"postbump": "pnpm check:write && git add ."
}
},
"devDependencies": {
"@biomejs/biome": "^2.3.5",
"@changesets/cli": "^2.29.7",
"@commitlint/cli": "^20.1.0",
"@commitlint/config-conventional": "^20.0.0",
"@types/node": "^24.10.1",
Expand All @@ -59,9 +56,7 @@
"fs-extra": "^11.3.2",
"husky": "^9.1.7",
"knip": "^5.69.1",
"lerna": "^9.0.0",
"lint-staged": "^16.2.6",
"standard-version": "^9.5.0",
"typescript": "^5.9.3"
},
"optionalDependencies": {
Expand Down
Loading