Skip to content

Commit e77c301

Browse files
committed
chore: release 2.0.0-rc.2
1 parent 48f5bf7 commit e77c301

6 files changed

Lines changed: 604 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: "18"
18+
registry-url: "https://registry.npmjs.org"
19+
20+
- name: Install dependencies
21+
run: make install
22+
23+
- name: Build
24+
run: make build
25+
26+
- name: Publish to npm
27+
run: |
28+
if [[ "${{ github.ref }}" =~ -rc\.[0-9]+$ ]]; then
29+
make publish-rc
30+
else
31+
make publish
32+
fi
33+
env:
34+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Makefile

Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
.PHONY: help build test lint type-check clean install release-rc release-patch release-minor release-major publish-rc publish prepublish
2+
3+
# Default target
4+
help:
5+
@echo "Authorizer React - Makefile Commands"
6+
@echo ""
7+
@echo "Development:"
8+
@echo " make install - Install dependencies"
9+
@echo " make build - Build the library"
10+
@echo " make start - Start watch mode"
11+
@echo " make test - Run tests"
12+
@echo " make lint - Run linter"
13+
@echo " make type-check - Run TypeScript type checking"
14+
@echo " make clean - Clean build artifacts"
15+
@echo ""
16+
@echo "Release (RC):"
17+
@echo " make release-rc [VERSION=X.X.X-rc.X] - Create RC release (interactive)"
18+
@echo " make publish-rc - Publish RC to npm (with confirmation)"
19+
@echo ""
20+
@echo "Release (Stable):"
21+
@echo " make release-patch - Bump patch version (1.0.0 -> 1.0.1, interactive)"
22+
@echo " make release-minor - Bump minor version (1.0.0 -> 1.1.0, interactive)"
23+
@echo " make release-major - Bump major version (1.0.0 -> 2.0.0, interactive)"
24+
@echo " make publish - Publish stable to npm (with confirmation)"
25+
@echo ""
26+
@echo "Note: All release commands are interactive and will:"
27+
@echo " - Show current and new version"
28+
@echo " - Ask for confirmation before making changes"
29+
@echo ""
30+
@echo "Example:"
31+
@echo " make release-rc VERSION=2.0.0-rc.1"
32+
@echo " make release-patch # Will auto-calculate and ask for confirmation"
33+
34+
# Development commands
35+
install:
36+
@echo "📦 Installing dependencies..."
37+
npm install
38+
39+
build:
40+
@echo "🔨 Building library..."
41+
npm run build
42+
@echo "✅ Build complete!"
43+
44+
start:
45+
@echo "👀 Starting watch mode..."
46+
npm start
47+
48+
test:
49+
@echo "🧪 Running tests..."
50+
npm test
51+
52+
lint:
53+
@echo "🔍 Running linter..."
54+
npm run lint
55+
56+
type-check:
57+
@echo "📝 Type checking..."
58+
npm run type-check
59+
60+
clean:
61+
@echo "🧹 Cleaning build artifacts..."
62+
rm -rf dist
63+
rm -rf node_modules/.cache
64+
@echo "✅ Clean complete!"
65+
66+
# Release commands
67+
release-rc:
68+
@CURRENT=$$(npm pkg get version | tr -d '"'); \
69+
if [ -z "$(VERSION)" ]; then \
70+
echo ""; \
71+
echo "Current version: $$CURRENT"; \
72+
echo ""; \
73+
echo "Enter the RC version (e.g., 2.0.0-rc.1):"; \
74+
read -r VERSION; \
75+
if [ -z "$$VERSION" ]; then \
76+
echo "❌ Error: VERSION is required"; \
77+
exit 1; \
78+
fi; \
79+
else \
80+
VERSION=$(VERSION); \
81+
fi; \
82+
echo ""; \
83+
echo "🚀 Creating RC release: $$VERSION"; \
84+
echo "📝 Will update package.json from $$CURRENT to $$VERSION"; \
85+
echo ""; \
86+
echo "⚠️ This will:"; \
87+
echo " - Update package.json version to $$VERSION"; \
88+
echo " - Build the library"; \
89+
echo ""; \
90+
read -p "Continue? (y/N): " confirm; \
91+
if [ "$$confirm" != "y" ] && [ "$$confirm" != "Y" ]; then \
92+
echo "❌ Release cancelled"; \
93+
exit 1; \
94+
fi; \
95+
echo ""; \
96+
echo "📝 Updating package.json version..."; \
97+
npm pkg set version=$$VERSION; \
98+
echo "🔨 Building library..."; \
99+
npm run build; \
100+
echo ""; \
101+
echo "✅ RC release $$VERSION ready!"; \
102+
echo ""; \
103+
echo "📋 Release Checklist:"; \
104+
echo " ✓ Version updated to $$VERSION"; \
105+
echo " ✓ Library built successfully"; \
106+
echo ""; \
107+
echo "Next steps (manual):"; \
108+
echo " 1. Review changes: git status && git diff"; \
109+
echo " 2. Commit: git add . && git commit -m 'chore: release $$VERSION'"; \
110+
echo " 3. Tag: git tag v$$VERSION"; \
111+
echo " 4. Push: git push origin main && git push origin v$$VERSION"; \
112+
echo " 5. Publish: make publish-rc"
113+
114+
release-patch:
115+
@CURRENT=$$(npm pkg get version | tr -d '"'); \
116+
BASE=$$(echo "$$CURRENT" | sed 's/-.*//'); \
117+
NEW=$$(node -p "const v='$$BASE'.split('.'); v[2]=(parseInt(v[2])+1).toString(); v.join('.')"); \
118+
echo ""; \
119+
echo "🚀 Creating patch release..."; \
120+
echo "📝 Current version: $$CURRENT"; \
121+
echo "📝 New version: $$NEW"; \
122+
echo ""; \
123+
echo "⚠️ This will:"; \
124+
echo " - Update package.json version from $$CURRENT to $$NEW"; \
125+
echo " - Build the library"; \
126+
echo ""; \
127+
read -p "Continue? (y/N): " confirm; \
128+
if [ "$$confirm" != "y" ] && [ "$$confirm" != "Y" ]; then \
129+
echo "❌ Release cancelled"; \
130+
exit 1; \
131+
fi; \
132+
echo ""; \
133+
npm pkg set version=$$NEW; \
134+
echo "📝 Version updated to: $$NEW"; \
135+
make build; \
136+
echo "✅ Patch release $$NEW ready!"
137+
138+
release-minor:
139+
@CURRENT=$$(npm pkg get version | tr -d '"'); \
140+
BASE=$$(echo "$$CURRENT" | sed 's/-.*//'); \
141+
NEW=$$(node -p "const v='$$BASE'.split('.'); v[1]=(parseInt(v[1])+1).toString(); v[2]='0'; v.join('.')"); \
142+
echo ""; \
143+
echo "🚀 Creating minor release..."; \
144+
echo "📝 Current version: $$CURRENT"; \
145+
echo "📝 New version: $$NEW"; \
146+
echo ""; \
147+
echo "⚠️ This will:"; \
148+
echo " - Update package.json version from $$CURRENT to $$NEW"; \
149+
echo " - Build the library"; \
150+
echo ""; \
151+
read -p "Continue? (y/N): " confirm; \
152+
if [ "$$confirm" != "y" ] && [ "$$confirm" != "Y" ]; then \
153+
echo "❌ Release cancelled"; \
154+
exit 1; \
155+
fi; \
156+
echo ""; \
157+
npm pkg set version=$$NEW; \
158+
echo "📝 Version updated to: $$NEW"; \
159+
make build; \
160+
echo "✅ Minor release $$NEW ready!"
161+
162+
release-major:
163+
@CURRENT=$$(npm pkg get version | tr -d '"'); \
164+
BASE=$$(echo "$$CURRENT" | sed 's/-.*//'); \
165+
NEW=$$(node -p "const v='$$BASE'.split('.'); v[0]=(parseInt(v[0])+1).toString(); v[1]='0'; v[2]='0'; v.join('.')"); \
166+
echo ""; \
167+
echo "🚀 Creating major release..."; \
168+
echo "📝 Current version: $$CURRENT"; \
169+
echo "📝 New version: $$NEW"; \
170+
echo ""; \
171+
echo "⚠️ This will:"; \
172+
echo " - Update package.json version from $$CURRENT to $$NEW"; \
173+
echo " - Build the library"; \
174+
echo ""; \
175+
read -p "Continue? (y/N): " confirm; \
176+
if [ "$$confirm" != "y" ] && [ "$$confirm" != "Y" ]; then \
177+
echo "❌ Release cancelled"; \
178+
exit 1; \
179+
fi; \
180+
echo ""; \
181+
npm pkg set version=$$NEW; \
182+
echo "📝 Version updated to: $$NEW"; \
183+
make build; \
184+
echo "✅ Major release $$NEW ready!"
185+
186+
# Publish commands
187+
publish-rc:
188+
@VERSION=$$(npm pkg get version | tr -d '"'); \
189+
if [[ ! "$$VERSION" =~ -rc\.[0-9]+$$ ]]; then \
190+
echo "❌ Error: Version $$VERSION doesn't look like an RC (should end with -rc.X)"; \
191+
exit 1; \
192+
fi; \
193+
echo ""; \
194+
echo "📦 Publishing RC to npm..."; \
195+
echo "📦 Package: @authorizerdev/authorizer-react"; \
196+
echo "📦 Version: $$VERSION"; \
197+
echo "📦 Tag: rc"; \
198+
echo ""; \
199+
echo "⚠️ This will publish to npm registry"; \
200+
read -p "Continue? (y/N): " confirm; \
201+
if [ "$$confirm" != "y" ] && [ "$$confirm" != "Y" ]; then \
202+
echo "❌ Publish cancelled"; \
203+
exit 1; \
204+
fi; \
205+
echo ""; \
206+
npm publish --tag rc --access public; \
207+
echo ""; \
208+
echo "✅ Published @authorizerdev/authorizer-react@$$VERSION to npm with 'rc' tag!"
209+
210+
publish:
211+
@VERSION=$$(npm pkg get version | tr -d '"'); \
212+
if [[ "$$VERSION" =~ -rc\.[0-9]+$$ ]]; then \
213+
echo "❌ Error: Version $$VERSION is an RC. Use 'make publish-rc' instead"; \
214+
exit 1; \
215+
fi; \
216+
echo ""; \
217+
echo "📦 Publishing stable release to npm..."; \
218+
echo "📦 Package: @authorizerdev/authorizer-react"; \
219+
echo "📦 Version: $$VERSION"; \
220+
echo "📦 Tag: latest"; \
221+
echo ""; \
222+
echo "⚠️ This will publish to npm registry as latest"; \
223+
read -p "Continue? (y/N): " confirm; \
224+
if [ "$$confirm" != "y" ] && [ "$$confirm" != "Y" ]; then \
225+
echo "❌ Publish cancelled"; \
226+
exit 1; \
227+
fi; \
228+
echo ""; \
229+
npm publish --access public; \
230+
echo ""; \
231+
echo "✅ Published @authorizerdev/authorizer-react@$$VERSION to npm!"
232+
233+
# Pre-publish checks
234+
prepublish: clean build type-check lint
235+
@echo "✅ All pre-publish checks passed!"
236+
237+
# Full release workflow (for stable releases)
238+
full-release-patch: prepublish release-patch
239+
@echo "✅ Full patch release workflow complete!"
240+
241+
full-release-minor: prepublish release-minor
242+
@echo "✅ Full minor release workflow complete!"
243+
244+
full-release-major: prepublish release-major
245+
@echo "✅ Full major release workflow complete!"
246+

RELEASE.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Release Guide
2+
3+
This guide explains how to release new versions of `@authorizerdev/authorizer-react`.
4+
5+
## Quick Release (RC)
6+
7+
For release candidates:
8+
9+
```bash
10+
# Option 1: Interactive (will prompt for version)
11+
make release-rc
12+
13+
# Option 2: With version specified
14+
make release-rc VERSION=2.0.0-rc.1
15+
16+
# The command will:
17+
# - Show current version
18+
# - Show what will change
19+
# - Ask for confirmation
20+
# - Update package.json
21+
# - Build the library
22+
23+
# Then commit and publish:
24+
git add .
25+
git commit -m "chore: release 2.0.0-rc.1"
26+
git tag v2.0.0-rc.1
27+
git push origin main && git push origin v2.0.0-rc.1
28+
make publish-rc # Will also ask for confirmation
29+
```
30+
31+
## Quick Release (Stable)
32+
33+
For stable releases:
34+
35+
```bash
36+
# Interactive release (auto-calculates version, asks for confirmation)
37+
make release-patch # 2.0.0 -> 2.0.1
38+
make release-minor # 2.0.0 -> 2.1.0
39+
make release-major # 2.0.0 -> 3.0.0
40+
41+
# The command will:
42+
# - Show current and new version
43+
# - Ask for confirmation
44+
# - Update package.json automatically
45+
# - Build the library
46+
47+
# Then commit and publish:
48+
VERSION=$(npm pkg get version | tr -d '"')
49+
git add .
50+
git commit -m "chore: release $VERSION"
51+
git tag v$VERSION
52+
git push origin main && git push origin v$VERSION
53+
make publish # Will also ask for confirmation
54+
```
55+
56+
## Release Checklist
57+
58+
Before releasing, ensure:
59+
60+
- [ ] All tests pass: `make test`
61+
- [ ] Linting passes: `make lint`
62+
- [ ] Type checking passes: `make type-check`
63+
- [ ] Build succeeds: `make build`
64+
- [ ] CHANGELOG.md is updated
65+
- [ ] Version is correct in package.json
66+
- [ ] Example app works: `cd example && npm start`
67+
- [ ] No console errors in browser
68+
- [ ] Styles load correctly
69+
70+
## Version Numbering
71+
72+
- **RC releases**: `2.0.0-rc.1`, `2.0.0-rc.2`, etc.
73+
- **Patch releases**: `2.0.0``2.0.1` (bug fixes)
74+
- **Minor releases**: `2.0.0``2.1.0` (new features, backward compatible)
75+
- **Major releases**: `2.0.0``3.0.0` (breaking changes)
76+
77+
## Makefile Commands
78+
79+
### Development
80+
- `make install` - Install dependencies
81+
- `make build` - Build the library
82+
- `make start` - Start watch mode
83+
- `make lint` - Run linter
84+
- `make type-check` - TypeScript type checking
85+
- `make clean` - Clean build artifacts
86+
87+
### Release
88+
- `make release-rc VERSION=X.X.X-rc.X` - Create RC release
89+
- `make release-patch` - Bump patch version
90+
- `make release-minor` - Bump minor version
91+
- `make release-major` - Bump major version
92+
- `make publish-rc` - Publish RC to npm (with `rc` tag)
93+
- `make publish` - Publish stable to npm (with `latest` tag)
94+
95+
### Full Workflow
96+
- `make full-release-patch` - Run checks + bump patch + build
97+
- `make full-release-minor` - Run checks + bump minor + build
98+
- `make full-release-major` - Run checks + bump major + build
99+
100+
## Current Release: 2.0.0-rc.1
101+
102+
This RC includes:
103+
- ✅ Migration from tsdx to tsup
104+
- ✅ Updated to authorizer-js@3.0.0-rc.1
105+
- ✅ Fixed styling system (CSS variables)
106+
- ✅ Updated React to 18.3.1
107+
- ✅ Modern build output (CJS/ESM)
108+
- ✅ Improved TypeScript support
109+

0 commit comments

Comments
 (0)