Skip to content

Commit 60a6220

Browse files
committed
chore: add release-it for npm publishing and GitHub releases
- Add release-it with conventional-changelog plugin - Add repository, homepage, bugs fields to package.json - Add release script - Create CHANGELOG.md - Document release process in infrastructure rules
1 parent 281d187 commit 60a6220

File tree

5 files changed

+2971
-246
lines changed

5 files changed

+2971
-246
lines changed

.cursor/rules/project-infrastructure.mdc

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,3 +245,55 @@ jobs:
245245

246246
- **Push** to `main` branch
247247
- **Pull requests** targeting `main`
248+
249+
## Releasing
250+
251+
### release-it
252+
253+
The project uses `release-it` with the `@release-it/conventional-changelog` plugin for automated releases.
254+
255+
```bash
256+
npm run release
257+
```
258+
259+
This will:
260+
1. Run lint, typecheck, and tests
261+
2. Bump version based on conventional commits
262+
3. Generate/update CHANGELOG.md
263+
4. Create git tag
264+
5. Push to GitHub
265+
6. Create GitHub Release with changelog
266+
7. Publish to npm
267+
268+
### Release Configuration
269+
270+
```json
271+
// .release-it.json
272+
{
273+
"git": {
274+
"commitMessage": "chore: release v${version}",
275+
"tagName": "v${version}"
276+
},
277+
"github": {
278+
"release": true
279+
},
280+
"npm": {
281+
"publish": true
282+
},
283+
"plugins": {
284+
"@release-it/conventional-changelog": {
285+
"preset": "conventionalcommits",
286+
"infile": "CHANGELOG.md"
287+
}
288+
}
289+
}
290+
```
291+
292+
### Required Dev Dependencies
293+
294+
```json
295+
{
296+
"release-it": "^18.x",
297+
"@release-it/conventional-changelog": "^10.x"
298+
}
299+
```

.release-it.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"git": {
3+
"commitMessage": "chore: release v${version}",
4+
"tagName": "v${version}"
5+
},
6+
"github": {
7+
"release": true,
8+
"releaseName": "v${version}"
9+
},
10+
"npm": {
11+
"publish": true
12+
},
13+
"plugins": {
14+
"@release-it/conventional-changelog": {
15+
"preset": {
16+
"name": "conventionalcommits",
17+
"types": [
18+
{ "type": "feat", "section": "Features" },
19+
{ "type": "fix", "section": "Bug Fixes" },
20+
{ "type": "docs", "section": "Documentation" },
21+
{ "type": "refactor", "section": "Refactoring" },
22+
{ "type": "perf", "section": "Performance" },
23+
{ "type": "test", "section": "Tests" },
24+
{ "type": "chore", "hidden": true }
25+
]
26+
},
27+
"infile": "CHANGELOG.md"
28+
}
29+
},
30+
"hooks": {
31+
"before:init": ["npm run lint", "npm run typecheck", "npm test"],
32+
"after:bump": "npm run build"
33+
}
34+
}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+

0 commit comments

Comments
 (0)