relizy 0.2.8 → 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +109 -1093
- package/dist/cli.mjs +18 -3
- package/dist/index.d.mts +415 -14
- package/dist/index.d.ts +415 -14
- package/dist/index.mjs +2 -2
- package/dist/shared/{relizy.DwP99Z7x.mjs → relizy.C2HlcnZB.mjs} +2194 -1449
- package/package.json +21 -3
package/README.md
CHANGED
|
@@ -7,7 +7,24 @@
|
|
|
7
7
|
A tool to manage releases for monorepos and single packages.
|
|
8
8
|
</strong>
|
|
9
9
|
</p>
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
<p>
|
|
12
|
+
<a href="https://codecov.io/gh/LouisMazel/relizy">
|
|
13
|
+
<img src="https://codecov.io/gh/LouisMazel/relizy/branch/main/graph/badge.svg?token=YOUR_TOKEN_HERE" alt="codecov" />
|
|
14
|
+
</a>
|
|
15
|
+
<a href="https://github.com/LouisMazel/relizy/actions/workflows/test-unit.yml">
|
|
16
|
+
<img src="https://github.com/LouisMazel/relizy/actions/workflows/test-unit.yml/badge.svg" alt="Unit Tests" />
|
|
17
|
+
</a>
|
|
18
|
+
<a href="https://www.npmjs.com/package/relizy">
|
|
19
|
+
<img src="https://img.shields.io/npm/v/relizy.svg" alt="npm version" />
|
|
20
|
+
</a>
|
|
21
|
+
<a href="https://www.npmjs.com/package/relizy">
|
|
22
|
+
<img src="https://img.shields.io/npm/dm/relizy.svg" alt="npm downloads" />
|
|
23
|
+
</a>
|
|
24
|
+
</p>
|
|
25
|
+
|
|
26
|
+
<a href="https://louismazel.github.io/relizy/">Documentation</a>
|
|
27
|
+
|
|
11
28
|
</div>
|
|
12
29
|
|
|
13
30
|
---
|
|
@@ -22,6 +39,7 @@ Imagine you have multiple packages in your project (like a box with several toys
|
|
|
22
39
|
2. **Create changelogs** to explain what changed
|
|
23
40
|
3. **Publish your packages** to npm so others can use them
|
|
24
41
|
4. **Create releases** on GitHub or GitLab
|
|
42
|
+
5. **Announce releases** automatically on Twitter and Slack
|
|
25
43
|
|
|
26
44
|
## ✨ Features
|
|
27
45
|
|
|
@@ -32,11 +50,12 @@ Imagine you have multiple packages in your project (like a box with several toys
|
|
|
32
50
|
- 🏷️ Pre-release support (alpha, beta, rc)
|
|
33
51
|
- 📢 NPM publish with smart tag detection
|
|
34
52
|
- 🔗 Automatic dependency bumping for workspace dependencies
|
|
35
|
-
- 🐙 GitHub &
|
|
53
|
+
- 🐙 GitHub, GitLab & Bitbucket support
|
|
36
54
|
- 🔐 2FA/OTP support for npm publishing
|
|
37
55
|
- 🎛️ Custom registry support (private registries, GitHub Packages, etc.)
|
|
38
56
|
- ⚙️ Multiple configuration files support for different release workflows
|
|
39
57
|
- 🔧 Support for npm, yarn, pnpm, and bun (auto-detected)
|
|
58
|
+
- 📱 Social media integration (Twitter & Slack) for release announcements
|
|
40
59
|
|
|
41
60
|
## 📚 Documentation
|
|
42
61
|
|
|
@@ -48,1189 +67,186 @@ You can [find the documentation here](https://louismazel.github.io/relizy/).
|
|
|
48
67
|
pnpm add -D relizy
|
|
49
68
|
```
|
|
50
69
|
|
|
51
|
-
##
|
|
52
|
-
|
|
53
|
-
This tool automatically detects your package manager and uses the appropriate commands:
|
|
54
|
-
|
|
55
|
-
- **npm** - Standard npm registry commands
|
|
56
|
-
- **yarn** - Supports both Yarn Classic and Yarn Berry
|
|
57
|
-
- **pnpm** - Optimized for pnpm workspaces
|
|
58
|
-
- **bun** - Full support for bun package manager
|
|
59
|
-
|
|
60
|
-
Detection is automatic based on:
|
|
61
|
-
|
|
62
|
-
1. `packageManager` field in package.json
|
|
63
|
-
2. Lock file presence (pnpm-lock.yaml, yarn.lock, package-lock.json, bun.lockb)
|
|
64
|
-
3. npm_config_user_agent environment variable
|
|
65
|
-
|
|
66
|
-
## ⚙️ Minimal configuration
|
|
67
|
-
|
|
68
|
-
Create a configuration file in the root of your project. The config file is loaded using [c12](https://github.com/unjs/c12), which supports multiple formats.
|
|
69
|
-
|
|
70
|
-
### Supported Configuration Formats
|
|
71
|
-
|
|
72
|
-
You can use any of these formats for your configuration file:
|
|
70
|
+
## 🚀 Quick Start
|
|
73
71
|
|
|
74
|
-
|
|
75
|
-
- **JSON:** `.json`, `.jsonc`, `.json5`
|
|
76
|
-
- **YAML:** `.yaml`, `.yml`
|
|
77
|
-
- **TOML:** `.toml`
|
|
72
|
+
Install Relizy in your project:
|
|
78
73
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
- `relizy.config.yaml` (YAML)
|
|
85
|
-
|
|
86
|
-
### Minimal Configuration Example
|
|
74
|
+
```bash
|
|
75
|
+
pnpm add -D relizy
|
|
76
|
+
# or npm install -D relizy
|
|
77
|
+
# or yarn add -D relizy
|
|
78
|
+
```
|
|
87
79
|
|
|
88
|
-
|
|
80
|
+
Create a simple configuration file `relizy.config.ts`:
|
|
89
81
|
|
|
90
82
|
```typescript
|
|
91
|
-
// relizy.config.ts
|
|
92
83
|
import { defineConfig } from 'relizy'
|
|
93
84
|
|
|
94
85
|
export default defineConfig({
|
|
95
86
|
monorepo: {
|
|
96
|
-
versionMode: 'selective',
|
|
97
|
-
packages: ['packages/*'],
|
|
87
|
+
versionMode: 'selective',
|
|
88
|
+
packages: ['packages/*'],
|
|
98
89
|
},
|
|
99
90
|
})
|
|
100
91
|
```
|
|
101
92
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
```json
|
|
105
|
-
{
|
|
106
|
-
"monorepo": {
|
|
107
|
-
"versionMode": "selective",
|
|
108
|
-
"packages": ["packages/*"]
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
**YAML:**
|
|
114
|
-
|
|
115
|
-
```yaml
|
|
116
|
-
monorepo:
|
|
117
|
-
versionMode: selective
|
|
118
|
-
packages:
|
|
119
|
-
- packages/*
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
Check all options in the [configuration section](#configuration-options).
|
|
123
|
-
|
|
124
|
-
## 🚀 Usage
|
|
125
|
-
|
|
126
|
-
### Available commands
|
|
127
|
-
|
|
128
|
-
The CLI uses the `relizy` command:
|
|
93
|
+
That's it! Now you can release with a single command:
|
|
129
94
|
|
|
130
95
|
```bash
|
|
131
|
-
relizy <command> [options]
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
#### 1. `release` - Complete release workflow
|
|
135
|
-
|
|
136
|
-
Executes the entire release workflow in one command:
|
|
137
|
-
|
|
138
|
-
1. Bump versions
|
|
139
|
-
2. Generate changelogs
|
|
140
|
-
3. Commit changes
|
|
141
|
-
4. Create git tag
|
|
142
|
-
5. Push to remote
|
|
143
|
-
6. Publish to npm
|
|
144
|
-
7. Create GitHub or GitLab release
|
|
145
|
-
|
|
146
|
-
```bash
|
|
147
|
-
# Complete release
|
|
148
96
|
relizy release
|
|
149
|
-
|
|
150
|
-
# Release with pre-release
|
|
151
|
-
relizy release --prerelease --preid beta --tag beta
|
|
152
|
-
|
|
153
|
-
# Release with custom suffix (see bump --suffix)
|
|
154
|
-
relizy release --prerelease --preid beta --suffix abc123
|
|
155
|
-
|
|
156
|
-
# Without push to remote
|
|
157
|
-
relizy release --patch --no-push
|
|
158
|
-
|
|
159
|
-
# Without GitHub/GitLab release creation
|
|
160
|
-
relizy release --patch --no-provider-release
|
|
161
|
-
|
|
162
|
-
# Without npm publish
|
|
163
|
-
relizy release --patch --no-publish
|
|
164
|
-
|
|
165
|
-
# Without git verification (skip hooks)
|
|
166
|
-
relizy release --patch --no-verify
|
|
167
|
-
|
|
168
|
-
# With npm options
|
|
169
|
-
relizy release --patch --registry https://npm.pkg.github.com --access public --otp 123456
|
|
170
|
-
|
|
171
|
-
# Force even without commits
|
|
172
|
-
relizy release --patch --force
|
|
173
97
|
```
|
|
174
98
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
All options from `bump`, `changelog`, `publish` and `provider-release` are available, and:
|
|
99
|
+
This will automatically:
|
|
178
100
|
|
|
179
|
-
-
|
|
180
|
-
-
|
|
181
|
-
-
|
|
182
|
-
-
|
|
183
|
-
-
|
|
184
|
-
-
|
|
185
|
-
-
|
|
186
|
-
- `--token <token>` - Git token (GitHub or GitLab)
|
|
187
|
-
- `--force` - Force bump even without commits
|
|
188
|
-
- `--yes` - Skip confirmation prompt
|
|
189
|
-
- `--build-cmd <cmd>` - Command to build packages before publish
|
|
190
|
-
- `--suffix <suffix>` - Custom suffix for prerelease versions (see [bump --suffix](#--suffix))
|
|
101
|
+
- Detect the version bump from your commits
|
|
102
|
+
- Update all package versions
|
|
103
|
+
- Generate changelogs
|
|
104
|
+
- Commit and tag your changes
|
|
105
|
+
- Push to your git repository
|
|
106
|
+
- Create a release on GitHub/GitLab
|
|
107
|
+
- Publish to npm
|
|
191
108
|
|
|
192
|
-
|
|
109
|
+
## 💡 What Can You Use This For?
|
|
193
110
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
```bash
|
|
197
|
-
# Auto-detect bump type from commits
|
|
198
|
-
relizy bump
|
|
199
|
-
|
|
200
|
-
# Specify bump type
|
|
201
|
-
relizy bump --patch # 1.0.0 → 1.0.1
|
|
202
|
-
relizy bump --minor # 1.0.0 → 1.1.0
|
|
203
|
-
relizy bump --major # 1.0.0 → 2.0.0
|
|
204
|
-
|
|
205
|
-
# Pre-releases
|
|
206
|
-
relizy bump --prerelease --preid beta # 1.0.0 → 1.0.1-beta.0
|
|
207
|
-
relizy bump --premajor --preid alpha # 1.0.0 → 2.0.0-alpha.0
|
|
208
|
-
relizy bump --preminor --preid rc # 1.0.0 → 1.1.0-rc.0
|
|
209
|
-
relizy bump --prepatch --preid beta # 1.0.0 → 1.0.1-beta.0
|
|
210
|
-
|
|
211
|
-
# Pre-releases with custom suffix
|
|
212
|
-
relizy bump --prepatch --preid beta --suffix abc123 # 1.0.0 → 1.0.1-beta.abc123
|
|
213
|
-
relizy bump --prerelease --preid alpha --suffix 20241106 # 1.0.0-alpha.0 → 1.0.0-alpha.20241106
|
|
214
|
-
|
|
215
|
-
# Options
|
|
216
|
-
relizy bump --force # Force bump even without commits
|
|
217
|
-
relizy bump --yes # Skip confirmation prompt
|
|
218
|
-
relizy bump --no-clean # Skip working directory clean check
|
|
219
|
-
```
|
|
111
|
+
Relizy isn't just for publishing npm packages. You can use it for any project where you need version tracking and changelogs:
|
|
220
112
|
|
|
221
|
-
|
|
113
|
+
### Publishing npm Packages
|
|
222
114
|
|
|
223
|
-
|
|
224
|
-
- `--minor` - Bump minor version
|
|
225
|
-
- `--patch` - Bump patch version
|
|
226
|
-
- `--prerelease` - Bump prerelease version
|
|
227
|
-
- `--premajor` - Bump premajor version
|
|
228
|
-
- `--preminor` - Bump preminor version
|
|
229
|
-
- `--prepatch` - Bump prepatch version
|
|
230
|
-
- `--preid <id>` - Prerelease identifier (alpha, beta, rc, etc.)
|
|
231
|
-
- `--suffix <suffix>` - Custom suffix for prerelease versions
|
|
232
|
-
- `--force` - Force bump even without commits
|
|
233
|
-
- `--yes` - Skip confirmation prompt
|
|
234
|
-
- `--no-clean` - Skip working directory clean check
|
|
235
|
-
|
|
236
|
-
##### `--suffix`
|
|
237
|
-
|
|
238
|
-
The `--suffix` option allows you to customize the prerelease version number with a custom identifier instead of an auto-incremented number. This is particularly useful for CI/CD pipelines where you want to include build metadata in your version.
|
|
239
|
-
|
|
240
|
-
**How it works:**
|
|
241
|
-
|
|
242
|
-
When you use a prerelease bump type (`prepatch`, `preminor`, `premajor`, or `prerelease`) with the `--suffix` option, the version number's prerelease suffix will be replaced with your custom value instead of an auto-incremented number.
|
|
243
|
-
|
|
244
|
-
**Examples:**
|
|
115
|
+
Perfect for managing npm packages in a monorepo or single package repository. Automate the entire release workflow and let your team focus on building features.
|
|
245
116
|
|
|
246
117
|
```bash
|
|
247
|
-
|
|
248
|
-
relizy bump --prepatch --preid beta
|
|
249
|
-
# 1.0.0 → 1.0.1-beta.0
|
|
250
|
-
|
|
251
|
-
# With custom suffix
|
|
252
|
-
relizy bump --prepatch --preid beta --suffix abc123
|
|
253
|
-
# 1.0.0 → 1.0.1-beta.abc123
|
|
254
|
-
|
|
255
|
-
# Incrementing an existing prerelease with suffix
|
|
256
|
-
relizy bump --prerelease --preid beta --suffix xyz789
|
|
257
|
-
# 1.0.1-beta.0 → 1.0.1-beta.xyz789
|
|
258
|
-
|
|
259
|
-
# Common CI/CD use case: Git commit SHA
|
|
260
|
-
relizy bump --prerelease --preid alpha --suffix $(git rev-parse --short HEAD)
|
|
261
|
-
# 1.0.0-alpha.5 → 1.0.0-alpha.a1b2c3d
|
|
262
|
-
|
|
263
|
-
# Common CI/CD use case: Build number
|
|
264
|
-
relizy bump --prepatch --preid rc --suffix ${CI_PIPELINE_ID}
|
|
265
|
-
# 2.5.0 → 2.5.1-rc.12345
|
|
266
|
-
|
|
267
|
-
# Common CI/CD use case: Timestamp
|
|
268
|
-
relizy bump --preminor --preid beta --suffix $(date +%Y%m%d%H%M%S)
|
|
269
|
-
# 1.0.0 → 1.1.0-beta.20241106153045
|
|
118
|
+
relizy release --minor
|
|
270
119
|
```
|
|
271
120
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
- The `--suffix` option **only works with prerelease bump types** (`prepatch`, `preminor`, `premajor`, `prerelease`)
|
|
275
|
-
- It has **no effect on stable release types** (`patch`, `minor`, `major`)
|
|
276
|
-
- The suffix can contain letters, numbers, or hyphens
|
|
277
|
-
- Suffix values follow semantic versioning rules for prerelease identifiers
|
|
278
|
-
|
|
279
|
-
**Use cases:**
|
|
280
|
-
|
|
281
|
-
1. **CI/CD Pipelines**: Include build numbers, commit SHAs, or timestamps in your prerelease versions
|
|
282
|
-
2. **Feature Branches**: Create unique prerelease versions for different branches
|
|
283
|
-
3. **Testing**: Generate identifiable test releases
|
|
284
|
-
4. **Reproducible Builds**: Track exact build metadata in version numbers
|
|
121
|
+
### Versioning Private Applications
|
|
285
122
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
```yaml
|
|
289
|
-
- name: Bump prerelease version
|
|
290
|
-
run: |
|
|
291
|
-
pnpm relizy bump --prerelease --preid beta --suffix ${{ github.sha }}
|
|
292
|
-
```
|
|
293
|
-
|
|
294
|
-
**Example in CI/CD (GitLab CI):**
|
|
295
|
-
|
|
296
|
-
```yaml
|
|
297
|
-
bump:
|
|
298
|
-
script:
|
|
299
|
-
- pnpm relizy bump --prepatch --preid rc --suffix $CI_COMMIT_SHORT_SHA
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
#### 3. `changelog` - Generate changelogs
|
|
303
|
-
|
|
304
|
-
Generates CHANGELOG.md files for each package and at the root.
|
|
123
|
+
Use Relizy to version your private web applications, mobile apps, or internal tools. Keep track of what changed in each version with automatic changelog generation.
|
|
305
124
|
|
|
306
125
|
```bash
|
|
307
|
-
|
|
308
|
-
relizy changelog
|
|
309
|
-
|
|
310
|
-
# Specify commit range
|
|
311
|
-
relizy changelog --from v1.0.0
|
|
312
|
-
relizy changelog --from v1.0.0 --to v1.1.0
|
|
313
|
-
|
|
314
|
-
# Format after generation
|
|
315
|
-
relizy changelog --format-cmd "pnpm lint:fix"
|
|
316
|
-
|
|
317
|
-
# Without root changelog
|
|
318
|
-
relizy changelog --no-root-changelog
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
**Available options:**
|
|
322
|
-
|
|
323
|
-
- `--from <ref>` - Start commit reference
|
|
324
|
-
- `--to <ref>` - End commit reference
|
|
325
|
-
- `--format-cmd <cmd>` - Command to format CHANGELOGs after generation
|
|
326
|
-
- `--no-root-changelog` - Skip root changelog generation
|
|
327
|
-
|
|
328
|
-
#### 4. `publish` - Publish to npm
|
|
329
|
-
|
|
330
|
-
Publishes packages to npm registry (or other registry).
|
|
331
|
-
|
|
332
|
-
```bash
|
|
333
|
-
# Simple publish
|
|
334
|
-
relizy publish
|
|
335
|
-
|
|
336
|
-
# With custom registry
|
|
337
|
-
relizy publish --registry https://npm.pkg.github.com
|
|
338
|
-
|
|
339
|
-
# With custom tag
|
|
340
|
-
relizy publish --tag next
|
|
341
|
-
|
|
342
|
-
# For scoped packages (public access)
|
|
343
|
-
relizy publish --access public
|
|
344
|
-
|
|
345
|
-
# With 2FA
|
|
346
|
-
relizy publish --otp 123456
|
|
347
|
-
|
|
348
|
-
# Build before publish
|
|
349
|
-
relizy publish --build-cmd "pnpm build"
|
|
126
|
+
relizy release --patch --no-publish
|
|
350
127
|
```
|
|
351
128
|
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
- `--registry <url>` - Custom npm registry URL
|
|
355
|
-
- `--tag <tag>` - Publish tag (default: `latest` for stable, `next` for prerelease)
|
|
356
|
-
- `--access <type>` - Access level (`public` or `restricted`)
|
|
357
|
-
- `--otp <code>` - OTP code for 2FA
|
|
358
|
-
- `--build-cmd <cmd>` - Command to build packages before publish
|
|
129
|
+
### Release Announcements
|
|
359
130
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
- Stable version (e.g., `1.2.3`) → tag `latest`
|
|
363
|
-
- Prerelease version (e.g., `1.2.3-beta.0`) → tag `next`
|
|
364
|
-
|
|
365
|
-
#### 5. `provider-release` - Publish a release to git provider (github or gitlab)
|
|
366
|
-
|
|
367
|
-
Publishes a release for the latest tag.
|
|
131
|
+
Automatically post release announcements to Twitter and Slack when you ship new versions. Keep your users and team informed without manual work.
|
|
368
132
|
|
|
369
133
|
```bash
|
|
370
|
-
#
|
|
371
|
-
relizy provider-release
|
|
372
|
-
|
|
373
|
-
# With custom token
|
|
374
|
-
relizy provider-release --token YOUR_GITHUB_TOKEN
|
|
375
|
-
|
|
376
|
-
# Force git provider
|
|
377
|
-
relizy provider-release --provider github
|
|
378
|
-
|
|
379
|
-
# Specify range
|
|
380
|
-
relizy provider-release --from v1.0.0 --to v1.1.0
|
|
134
|
+
relizy release --minor # Automatically posts to configured social channels
|
|
381
135
|
```
|
|
382
136
|
|
|
383
|
-
|
|
137
|
+
## 📖 Learn More
|
|
384
138
|
|
|
385
|
-
|
|
386
|
-
- `--to <ref>` - End commit reference
|
|
387
|
-
- `--token <token>` - Git provider token
|
|
388
|
-
- `--provider <provider>` - Git provider (github or gitlab)
|
|
139
|
+
This README covers the basics to get you started quickly. For detailed documentation, configuration options, and advanced features, visit our full documentation:
|
|
389
140
|
|
|
390
|
-
**
|
|
141
|
+
**[📚 Full Documentation](https://louismazel.github.io/relizy/)**
|
|
391
142
|
|
|
392
|
-
|
|
143
|
+
Topics covered in the documentation:
|
|
393
144
|
|
|
394
|
-
-
|
|
395
|
-
-
|
|
396
|
-
-
|
|
397
|
-
|
|
398
|
-
|
|
145
|
+
- Complete configuration reference
|
|
146
|
+
- Monorepo versioning strategies (unified, selective, independent)
|
|
147
|
+
- CI/CD integration (GitHub Actions, GitLab CI)
|
|
148
|
+
- Social media integration (Twitter & Slack)
|
|
149
|
+
- Custom registries and private packages
|
|
150
|
+
- Multiple configuration files
|
|
151
|
+
- And much more...
|
|
399
152
|
|
|
400
|
-
|
|
153
|
+
## 🎨 Common Use Cases
|
|
401
154
|
|
|
402
|
-
|
|
155
|
+
Here are some quick examples to get you started:
|
|
403
156
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
Use `--config` to specify a custom configuration file name (without the file extension):
|
|
157
|
+
### Release a Patch Version
|
|
407
158
|
|
|
408
159
|
```bash
|
|
409
|
-
|
|
410
|
-
relizy bump --patch
|
|
411
|
-
|
|
412
|
-
# Use custom config (relizy.standalone.config.{ts,js,json,yaml,...})
|
|
413
|
-
relizy bump --config relizy.standalone --patch
|
|
414
|
-
|
|
415
|
-
# Use another config (relizy.experimental.config.{ts,js,json,yaml,...})
|
|
416
|
-
relizy release --config relizy.experimental --minor
|
|
160
|
+
relizy release --patch
|
|
417
161
|
```
|
|
418
162
|
|
|
419
|
-
|
|
163
|
+
This bumps the version (e.g., 1.0.0 → 1.0.1), generates the changelog, commits, tags, pushes, and publishes to npm.
|
|
420
164
|
|
|
421
|
-
|
|
422
|
-
- In the `--config` option, you only specify the `<name>` part (without `.config.<ext>`)
|
|
423
|
-
- Supported extensions: `.ts`, `.js`, `.mjs`, `.cjs`, `.mts`, `.cts`, `.json`, `.jsonc`, `.json5`, `.yaml`, `.yml`, `.toml`
|
|
424
|
-
|
|
425
|
-
#### Dry Run
|
|
426
|
-
|
|
427
|
-
Use `--dry-run` to preview changes without writing files, creating tags, commits, or publishing:
|
|
165
|
+
### Try Before You Commit (Dry Run)
|
|
428
166
|
|
|
429
167
|
```bash
|
|
430
|
-
# Preview bump
|
|
431
|
-
relizy bump --patch --dry-run
|
|
432
|
-
|
|
433
|
-
# Preview entire release workflow
|
|
434
168
|
relizy release --minor --dry-run
|
|
435
|
-
|
|
436
|
-
# Preview publish
|
|
437
|
-
relizy publish --dry-run
|
|
438
169
|
```
|
|
439
170
|
|
|
440
|
-
|
|
171
|
+
Preview exactly what will happen without making any changes.
|
|
441
172
|
|
|
442
|
-
|
|
173
|
+
### Skip Publishing for Private Apps
|
|
443
174
|
|
|
444
175
|
```bash
|
|
445
|
-
|
|
446
|
-
relizy bump
|
|
447
|
-
|
|
448
|
-
# Debug level (detailed information)
|
|
449
|
-
relizy release --patch --log-level debug
|
|
450
|
-
|
|
451
|
-
# Silent level (errors only)
|
|
452
|
-
relizy publish --log-level silent
|
|
176
|
+
relizy release --patch --no-publish
|
|
453
177
|
```
|
|
454
178
|
|
|
455
|
-
|
|
179
|
+
Perfect for versioning private applications where you don't need to publish to npm.
|
|
456
180
|
|
|
457
|
-
|
|
458
|
-
- `error` - Errors and critical warnings
|
|
459
|
-
- `warning` - Warnings and above
|
|
460
|
-
- `normal` - Normal information
|
|
461
|
-
- `default` - Essential information (default)
|
|
462
|
-
- `debug` - Detailed debugging information
|
|
463
|
-
- `trace` - Very detailed trace information
|
|
464
|
-
- `verbose` - Show everything
|
|
465
|
-
|
|
466
|
-
**Examples:**
|
|
181
|
+
### Pre-release Versions
|
|
467
182
|
|
|
468
183
|
```bash
|
|
469
|
-
|
|
470
|
-
$ relizy bump --patch
|
|
471
|
-
ℹ 4.2.0 → 4.2.1 (unified mode)
|
|
472
|
-
✔ All 3 package(s) bumped to 4.2.1
|
|
473
|
-
|
|
474
|
-
# Detailed output for debugging
|
|
475
|
-
$ relizy bump --patch --log-level debug
|
|
476
|
-
● Loading monorepo configuration
|
|
477
|
-
● Version mode: unified
|
|
478
|
-
● From: v4.2.0, To: HEAD
|
|
479
|
-
● Package patterns: packages/*
|
|
480
|
-
● Found 3 package(s)
|
|
481
|
-
● Starting bump in unified mode
|
|
482
|
-
● Fetching commits from v4.2.0 to HEAD
|
|
483
|
-
● Found 5 commits since v4.2.0
|
|
484
|
-
● Detected release type from commits: patch
|
|
485
|
-
ℹ 4.2.0 → 4.2.1 (unified mode)
|
|
486
|
-
● Writing version to 3 package(s)
|
|
487
|
-
● Updating lerna.json version
|
|
488
|
-
✔ All 3 package(s) bumped to 4.2.1
|
|
489
|
-
```
|
|
490
|
-
|
|
491
|
-
## ⚙️ Configuration
|
|
492
|
-
|
|
493
|
-
This tool extends [changelogen](https://github.com/unjs/changelogen) configuration with additional monorepo-specific options. Some options from changelogen are overridden to provide better monorepo support.
|
|
494
|
-
|
|
495
|
-
Create a `relizy.config.ts` file at the root of your project:
|
|
496
|
-
|
|
497
|
-
```typescript
|
|
498
|
-
import { defineConfig } from 'relizy'
|
|
499
|
-
|
|
500
|
-
export default defineConfig({
|
|
501
|
-
// Standard changelogen configuration
|
|
502
|
-
types: {
|
|
503
|
-
feat: { title: '🚀 Features', semver: 'minor' },
|
|
504
|
-
fix: { title: '🩹 Fixes', semver: 'patch' },
|
|
505
|
-
},
|
|
506
|
-
|
|
507
|
-
// Monorepo configuration
|
|
508
|
-
monorepo: {
|
|
509
|
-
versionMode: 'selective',
|
|
510
|
-
packages: ['packages/*'],
|
|
511
|
-
ignorePackageNames: [],
|
|
512
|
-
},
|
|
513
|
-
|
|
514
|
-
// Optional configuration
|
|
515
|
-
changelog: {
|
|
516
|
-
formatCmd: 'pnpm lint:fix',
|
|
517
|
-
rootChangelog: true,
|
|
518
|
-
},
|
|
519
|
-
|
|
520
|
-
bump: {
|
|
521
|
-
type: 'release',
|
|
522
|
-
preid: undefined,
|
|
523
|
-
},
|
|
524
|
-
|
|
525
|
-
publish: {
|
|
526
|
-
private: false,
|
|
527
|
-
tag: 'latest',
|
|
528
|
-
args: [],
|
|
529
|
-
},
|
|
530
|
-
|
|
531
|
-
release: {
|
|
532
|
-
push: true,
|
|
533
|
-
release: true,
|
|
534
|
-
publish: true,
|
|
535
|
-
noVerify: false,
|
|
536
|
-
},
|
|
537
|
-
})
|
|
538
|
-
```
|
|
539
|
-
|
|
540
|
-
### Configuration options
|
|
541
|
-
|
|
542
|
-
The configuration extends [ChangelogConfig](https://github.com/unjs/changelogen#configuration) from changelogen with additional monorepo-specific options.
|
|
543
|
-
|
|
544
|
-
#### `types`
|
|
545
|
-
|
|
546
|
-
**Type:** `Record<string, { title: string, semver?: 'major' | 'minor' | 'patch' } | false>`
|
|
547
|
-
|
|
548
|
-
**Description:** Defines commit types and their impact on versioning.
|
|
549
|
-
|
|
550
|
-
- With `semver`: Triggers a version bump
|
|
551
|
-
- `'major'`: Breaking changes → 1.0.0 → 2.0.0
|
|
552
|
-
- `'minor'`: New features → 1.0.0 → 1.1.0
|
|
553
|
-
- `'patch'`: Bug fixes → 1.0.0 → 1.0.1
|
|
554
|
-
- Without `semver`: Appears in changelog but doesn't trigger a bump
|
|
555
|
-
- `false`: Completely ignored (no changelog, no bump)
|
|
556
|
-
|
|
557
|
-
**Example:**
|
|
558
|
-
|
|
559
|
-
```typescript
|
|
560
|
-
export default defineConfig({
|
|
561
|
-
types: {
|
|
562
|
-
// Trigger a bump
|
|
563
|
-
feat: { title: '🚀 Features', semver: 'minor' },
|
|
564
|
-
fix: { title: '🩹 Fixes', semver: 'patch' },
|
|
565
|
-
perf: { title: '🔥 Performance', semver: 'patch' },
|
|
566
|
-
|
|
567
|
-
// Appear in changelog but no bump
|
|
568
|
-
docs: { title: '📖 Documentation' },
|
|
569
|
-
chore: { title: '🏡 Chore' },
|
|
570
|
-
|
|
571
|
-
// Completely ignored
|
|
572
|
-
ci: false,
|
|
573
|
-
test: false,
|
|
574
|
-
},
|
|
575
|
-
})
|
|
576
|
-
```
|
|
577
|
-
|
|
578
|
-
#### `monorepo`
|
|
579
|
-
|
|
580
|
-
Monorepo-specific configuration (required).
|
|
581
|
-
|
|
582
|
-
| Property | Type | Default | Description |
|
|
583
|
-
| -------------------- | ----------------------------------------------- | ---------------- | ---------------------------------------- |
|
|
584
|
-
| `versionMode` | `'unified'` \| `'selective'` \| `'independent'` | `'selective'` | How versions are managed across packages |
|
|
585
|
-
| `packages` | `string[]` | `['packages/*']` | Glob patterns to locate packages |
|
|
586
|
-
| `ignorePackageNames` | `string[]` | `[]` | Package names to ignore |
|
|
587
|
-
|
|
588
|
-
**Version modes:**
|
|
589
|
-
|
|
590
|
-
| Mode | Version | Scope | Root & Lerna | Best for |
|
|
591
|
-
| ------------------ | ----------- | -------------------------- | ------------ | ------------------------------ |
|
|
592
|
-
| **`selective`** ⭐ | Unified | Only packages with commits | ✅ Updated | Most monorepos |
|
|
593
|
-
| **`unified`** | Unified | ALL packages | ✅ Updated | Keep all packages synchronized |
|
|
594
|
-
| **`independent`** | Independent | Only packages with commits | ❌ Unchanged | Collections of unrelated tools |
|
|
595
|
-
|
|
596
|
-
**Examples:**
|
|
597
|
-
|
|
598
|
-
```typescript
|
|
599
|
-
export default defineConfig({
|
|
600
|
-
// Selective mode (recommended) - Only bump packages with commits
|
|
601
|
-
monorepo: {
|
|
602
|
-
versionMode: 'selective',
|
|
603
|
-
packages: ['packages/*'],
|
|
604
|
-
},
|
|
605
|
-
|
|
606
|
-
// Unified mode - Bump ALL packages together
|
|
607
|
-
// monorepo: {
|
|
608
|
-
// versionMode: 'unified',
|
|
609
|
-
// packages: ['packages/*', 'tools/*'],
|
|
610
|
-
// },
|
|
611
|
-
|
|
612
|
-
// Independent mode - Each package has its own version
|
|
613
|
-
// monorepo: {
|
|
614
|
-
// versionMode: 'independent',
|
|
615
|
-
// packages: ['packages/*'],
|
|
616
|
-
// ignorePackageNames: ['@myorg/internal-utils'],
|
|
617
|
-
// },
|
|
618
|
-
})
|
|
184
|
+
relizy release --prerelease --preid beta
|
|
619
185
|
```
|
|
620
186
|
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
Changelog generation configuration.
|
|
187
|
+
Creates beta versions like 1.0.0-beta.0 for testing before stable releases.
|
|
624
188
|
|
|
625
|
-
|
|
626
|
-
| ------------------- | --------- | ----------- | -------------------------------------------------- |
|
|
627
|
-
| `formatCmd` | `string` | `undefined` | Command to format changelogs after generation |
|
|
628
|
-
| `rootChangelog` | `boolean` | `true` | Generate root CHANGELOG.md with aggregated changes |
|
|
629
|
-
| `includeCommitBody` | `boolean` | `false` | Include full commit bodies in changelog entries |
|
|
630
|
-
|
|
631
|
-
**Example:**
|
|
632
|
-
|
|
633
|
-
```typescript
|
|
634
|
-
export default defineConfig({
|
|
635
|
-
changelog: {
|
|
636
|
-
formatCmd: 'pnpm lint:fix',
|
|
637
|
-
rootChangelog: true,
|
|
638
|
-
includeCommitBody: true,
|
|
639
|
-
},
|
|
640
|
-
})
|
|
641
|
-
```
|
|
642
|
-
|
|
643
|
-
#### `bump`
|
|
644
|
-
|
|
645
|
-
Version bump configuration.
|
|
646
|
-
|
|
647
|
-
| Property | Type | Default | Description |
|
|
648
|
-
| ----------------- | --------------------------------------------------------------------------- | ------------------ | ------------------------------------------------------- |
|
|
649
|
-
| `type` | `'release'` \| `'major'` \| `'minor'` \| `'patch'` \| `'prerelease'` \| ... | `'release'` | Default bump type ('release' auto-detects from commits) |
|
|
650
|
-
| `preid` | `string` | `undefined` | Pre-release identifier (alpha, beta, rc, etc.) |
|
|
651
|
-
| `clean` | `boolean` | `true` | Check if working directory is clean before bumping |
|
|
652
|
-
| `dependencyTypes` | `Array<'dependencies' \| 'devDependencies' \| 'peerDependencies'>` | `['dependencies']` | Which dependency types trigger a version bump |
|
|
653
|
-
| `yes` | `boolean` | `true` | Skip confirmation prompt |
|
|
654
|
-
|
|
655
|
-
**Dependency types:** When a package is updated, this decides which dependent packages should also be bumped:
|
|
656
|
-
|
|
657
|
-
- `dependencies` - Packages that need it to work
|
|
658
|
-
- `devDependencies` - Packages that need it for building/testing
|
|
659
|
-
- `peerDependencies` - Packages that work alongside it
|
|
660
|
-
|
|
661
|
-
**Example:**
|
|
662
|
-
|
|
663
|
-
```typescript
|
|
664
|
-
export default defineConfig({
|
|
665
|
-
bump: {
|
|
666
|
-
type: 'release',
|
|
667
|
-
dependencyTypes: ['dependencies', 'devDependencies'],
|
|
668
|
-
clean: true,
|
|
669
|
-
yes: true,
|
|
670
|
-
},
|
|
671
|
-
})
|
|
672
|
-
```
|
|
673
|
-
|
|
674
|
-
#### `publish`
|
|
675
|
-
|
|
676
|
-
npm publishing configuration.
|
|
677
|
-
|
|
678
|
-
| Property | Type | Default | Description |
|
|
679
|
-
| ---------- | ---------------------------- | ----------- | --------------------------------------------------- |
|
|
680
|
-
| `private` | `boolean` | `false` | Don't publish packages |
|
|
681
|
-
| `tag` | `string` | `'latest'` | npm tag (auto: 'latest' for stable, 'next' for pre) |
|
|
682
|
-
| `registry` | `string` | `undefined` | Custom registry URL |
|
|
683
|
-
| `access` | `'public'` \| `'restricted'` | `undefined` | Package access level |
|
|
684
|
-
| `otp` | `string` | `undefined` | One-time password for 2FA |
|
|
685
|
-
| `buildCmd` | `string` | `undefined` | Command to build packages before publish |
|
|
686
|
-
| `args` | `string[]` | `[]` | Additional arguments for publish command |
|
|
687
|
-
|
|
688
|
-
**Example:**
|
|
689
|
-
|
|
690
|
-
```typescript
|
|
691
|
-
export default defineConfig({
|
|
692
|
-
publish: {
|
|
693
|
-
private: false,
|
|
694
|
-
tag: 'latest',
|
|
695
|
-
registry: 'https://registry.npmjs.org',
|
|
696
|
-
access: 'public',
|
|
697
|
-
buildCmd: 'pnpm build',
|
|
698
|
-
},
|
|
699
|
-
})
|
|
700
|
-
```
|
|
701
|
-
|
|
702
|
-
#### `release`
|
|
703
|
-
|
|
704
|
-
Release workflow configuration.
|
|
705
|
-
|
|
706
|
-
| Property | Type | Default | Description |
|
|
707
|
-
| ----------- | --------- | ------- | ----------------------------------- |
|
|
708
|
-
| `commit` | `boolean` | `true` | Commit changes and create tag |
|
|
709
|
-
| `push` | `boolean` | `true` | Push changes and tags to remote |
|
|
710
|
-
| `changelog` | `boolean` | `true` | Generate changelog files |
|
|
711
|
-
| `release` | `boolean` | `true` | Create release on GitHub/GitLab |
|
|
712
|
-
| `publish` | `boolean` | `true` | Publish to npm |
|
|
713
|
-
| `clean` | `boolean` | `true` | Check if working directory is clean |
|
|
714
|
-
| `noVerify` | `boolean` | `false` | Skip git hooks during commit |
|
|
715
|
-
| `force` | `boolean` | `false` | Force bump even without commits |
|
|
716
|
-
|
|
717
|
-
**Example:**
|
|
718
|
-
|
|
719
|
-
```typescript
|
|
720
|
-
export default defineConfig({
|
|
721
|
-
release: {
|
|
722
|
-
commit: true,
|
|
723
|
-
push: true,
|
|
724
|
-
changelog: true,
|
|
725
|
-
release: true,
|
|
726
|
-
publish: true,
|
|
727
|
-
noVerify: false,
|
|
728
|
-
},
|
|
729
|
-
})
|
|
730
|
-
```
|
|
731
|
-
|
|
732
|
-
#### `repo`
|
|
733
|
-
|
|
734
|
-
Git repository configuration (auto-detected by default).
|
|
735
|
-
|
|
736
|
-
| Property | Type | Default | Description |
|
|
737
|
-
| ---------- | ------------------------ | ------------- | -------------------------------------- |
|
|
738
|
-
| `provider` | `'github'` \| `'gitlab'` | Auto-detected | Git provider (auto from remote URL) |
|
|
739
|
-
| `domain` | `string` | `undefined` | Custom domain for self-hosted instance |
|
|
740
|
-
| `repo` | `string` | Auto-detected | Repository in 'owner/repo' format |
|
|
741
|
-
| `token` | `string` | From env vars | Authentication token |
|
|
742
|
-
|
|
743
|
-
**Auto-detection:**
|
|
744
|
-
|
|
745
|
-
- Provider: Detected from git remote URL (github.com → GitHub, gitlab.com → GitLab)
|
|
746
|
-
- Repository: Parsed from git remote URL
|
|
747
|
-
- Token: Read from environment variables (see [tokens](#tokens) section)
|
|
748
|
-
|
|
749
|
-
**Example:**
|
|
750
|
-
|
|
751
|
-
```typescript
|
|
752
|
-
export default defineConfig({
|
|
753
|
-
// For self-hosted GitLab
|
|
754
|
-
repo: {
|
|
755
|
-
provider: 'gitlab',
|
|
756
|
-
domain: 'gitlab.mycompany.com',
|
|
757
|
-
},
|
|
758
|
-
})
|
|
759
|
-
```
|
|
760
|
-
|
|
761
|
-
#### `tokens`
|
|
762
|
-
|
|
763
|
-
Authentication tokens for git providers (read from environment variables by default).
|
|
764
|
-
|
|
765
|
-
| Property | Type | Default | Description |
|
|
766
|
-
| -------- | -------- | ------------- | --------------------------- |
|
|
767
|
-
| `github` | `string` | From env vars | GitHub authentication token |
|
|
768
|
-
| `gitlab` | `string` | From env vars | GitLab authentication token |
|
|
769
|
-
|
|
770
|
-
**Environment variables checked (in order):**
|
|
771
|
-
|
|
772
|
-
- GitHub: `RELIZY_GITHUB_TOKEN`, `GITHUB_TOKEN`, `GH_TOKEN`
|
|
773
|
-
- GitLab: `RELIZY_GITLAB_TOKEN`, `GITLAB_TOKEN`, `GITLAB_API_TOKEN`, `CI_JOB_TOKEN`
|
|
774
|
-
|
|
775
|
-
**Example:**
|
|
776
|
-
|
|
777
|
-
```typescript
|
|
778
|
-
export default defineConfig({
|
|
779
|
-
tokens: {
|
|
780
|
-
github: process.env.GITHUB_TOKEN,
|
|
781
|
-
gitlab: process.env.GITLAB_TOKEN,
|
|
782
|
-
},
|
|
783
|
-
})
|
|
784
|
-
```
|
|
785
|
-
|
|
786
|
-
#### `templates`
|
|
787
|
-
|
|
788
|
-
Templates for commit and tag messages.
|
|
789
|
-
|
|
790
|
-
| Property | Type | Default | Description |
|
|
791
|
-
| ----------------------- | -------- | -------------------------------------------------- | ------------------------------------------- |
|
|
792
|
-
| `commitMessage` | `string` | `'chore(release): bump version to {{newVersion}}'` | Commit message template |
|
|
793
|
-
| `tagMessage` | `string` | `'Bump version to v{{newVersion}}'` | Git tag message template |
|
|
794
|
-
| `tagBody` | `string` | `'v{{newVersion}}'` | Git tag body (not used in independent mode) |
|
|
795
|
-
| `emptyChangelogContent` | `string` | `'No relevant changes for this release'` | Changelog content when no changes |
|
|
796
|
-
|
|
797
|
-
**Available variables:** `{{newVersion}}`, `{{oldVersion}}`, `{{packageName}}`
|
|
798
|
-
|
|
799
|
-
**Example:**
|
|
800
|
-
|
|
801
|
-
```typescript
|
|
802
|
-
export default defineConfig({
|
|
803
|
-
templates: {
|
|
804
|
-
commitMessage: 'chore(release): v{{newVersion}} [skip ci]',
|
|
805
|
-
tagMessage: 'Release {{newVersion}}',
|
|
806
|
-
tagBody: 'Version {{newVersion}}',
|
|
807
|
-
},
|
|
808
|
-
})
|
|
809
|
-
```
|
|
810
|
-
|
|
811
|
-
#### `logLevel`
|
|
812
|
-
|
|
813
|
-
Control verbosity of command output.
|
|
814
|
-
|
|
815
|
-
**Type:** `'silent' | 'error' | 'warning' | 'normal' | 'default' | 'debug' | 'trace' | 'verbose'`
|
|
816
|
-
|
|
817
|
-
**Default:** `'default'`
|
|
818
|
-
|
|
819
|
-
See [Log Level](#log-level) section for details.
|
|
820
|
-
|
|
821
|
-
#### Inherited from Changelogen
|
|
822
|
-
|
|
823
|
-
The following options are inherited from [changelogen configuration](https://github.com/unjs/changelogen#configuration):
|
|
824
|
-
|
|
825
|
-
| Property | Type | Default | Description |
|
|
826
|
-
| ---------------- | ------------------------ | --------------- | ----------------------------------------- |
|
|
827
|
-
| `cwd` | `string` | `process.cwd()` | Working directory |
|
|
828
|
-
| `from` | `string` | Last git tag | Start reference for changelog |
|
|
829
|
-
| `to` | `string` | `HEAD` | End reference for changelog |
|
|
830
|
-
| `excludeAuthors` | `string[]` | `[]` | List of authors to exclude from changelog |
|
|
831
|
-
| `noAuthors` | `boolean` | `false` | Don't include authors in changelog |
|
|
832
|
-
| `scopeMap` | `Record<string, string>` | `{}` | Map scopes to custom names |
|
|
833
|
-
|
|
834
|
-
**Example:**
|
|
835
|
-
|
|
836
|
-
```typescript
|
|
837
|
-
export default defineConfig({
|
|
838
|
-
cwd: process.cwd(),
|
|
839
|
-
from: 'v1.0.0',
|
|
840
|
-
to: 'HEAD',
|
|
841
|
-
excludeAuthors: ['bot[bot]', 'dependabot'],
|
|
842
|
-
noAuthors: false,
|
|
843
|
-
scopeMap: {
|
|
844
|
-
ui: 'User Interface',
|
|
845
|
-
api: 'API',
|
|
846
|
-
},
|
|
847
|
-
})
|
|
848
|
-
```
|
|
849
|
-
|
|
850
|
-
### Configuration Examples
|
|
851
|
-
|
|
852
|
-
#### Simple configuration (selective mode)
|
|
853
|
-
|
|
854
|
-
```typescript
|
|
855
|
-
import { defineConfig } from 'relizy'
|
|
856
|
-
|
|
857
|
-
export default defineConfig({
|
|
858
|
-
types: {
|
|
859
|
-
feat: { title: '🚀 Features', semver: 'minor' },
|
|
860
|
-
fix: { title: '🩹 Fixes', semver: 'patch' },
|
|
861
|
-
},
|
|
862
|
-
monorepo: {
|
|
863
|
-
versionMode: 'selective',
|
|
864
|
-
packages: ['packages/*'],
|
|
865
|
-
},
|
|
866
|
-
})
|
|
867
|
-
```
|
|
868
|
-
|
|
869
|
-
#### Advanced configuration
|
|
870
|
-
|
|
871
|
-
```typescript
|
|
872
|
-
import { defineConfig } from 'relizy'
|
|
873
|
-
|
|
874
|
-
export default defineConfig({
|
|
875
|
-
types: {
|
|
876
|
-
feat: { title: '🚀 Features', semver: 'minor' },
|
|
877
|
-
fix: { title: '🩹 Fixes', semver: 'patch' },
|
|
878
|
-
perf: { title: '🔥 Performance', semver: 'patch' },
|
|
879
|
-
docs: { title: '📖 Documentation' },
|
|
880
|
-
chore: { title: '🏡 Chore' },
|
|
881
|
-
ci: false,
|
|
882
|
-
test: false,
|
|
883
|
-
},
|
|
884
|
-
|
|
885
|
-
monorepo: {
|
|
886
|
-
versionMode: 'selective',
|
|
887
|
-
packages: ['packages/*', 'tools/*'],
|
|
888
|
-
ignorePackageNames: ['@myorg/eslint-config'],
|
|
889
|
-
},
|
|
890
|
-
|
|
891
|
-
changelog: {
|
|
892
|
-
formatCmd: 'pnpm lint:fix',
|
|
893
|
-
rootChangelog: true,
|
|
894
|
-
},
|
|
895
|
-
|
|
896
|
-
bump: {
|
|
897
|
-
type: 'release',
|
|
898
|
-
},
|
|
899
|
-
|
|
900
|
-
publish: {
|
|
901
|
-
private: false,
|
|
902
|
-
tag: 'latest',
|
|
903
|
-
},
|
|
904
|
-
|
|
905
|
-
release: {
|
|
906
|
-
push: true,
|
|
907
|
-
release: true,
|
|
908
|
-
publish: true,
|
|
909
|
-
noVerify: false,
|
|
910
|
-
},
|
|
911
|
-
|
|
912
|
-
templates: {
|
|
913
|
-
commitMessage: 'chore(release): v{{newVersion}}',
|
|
914
|
-
},
|
|
915
|
-
})
|
|
916
|
-
```
|
|
917
|
-
|
|
918
|
-
#### Configuration for self-hosted GitLab
|
|
919
|
-
|
|
920
|
-
```typescript
|
|
921
|
-
import { defineConfig } from 'relizy'
|
|
922
|
-
|
|
923
|
-
export default defineConfig({
|
|
924
|
-
repo: {
|
|
925
|
-
domain: 'gitlab.mycompany.com',
|
|
926
|
-
provider: 'gitlab',
|
|
927
|
-
},
|
|
928
|
-
monorepo: {
|
|
929
|
-
versionMode: 'selective',
|
|
930
|
-
packages: ['packages/*'],
|
|
931
|
-
},
|
|
932
|
-
})
|
|
933
|
-
```
|
|
934
|
-
|
|
935
|
-
## 📁 Multiple Configuration Files
|
|
936
|
-
|
|
937
|
-
You can create multiple configuration files to manage different release workflows in your monorepo. This is useful when you have packages with different versioning strategies or release cadences.
|
|
938
|
-
|
|
939
|
-
### Use Cases
|
|
940
|
-
|
|
941
|
-
**Common scenarios for multiple configs:**
|
|
942
|
-
|
|
943
|
-
1. **Separate core packages from standalone utilities** - Core UI packages use `selective` mode together, while standalone utilities use `independent` mode
|
|
944
|
-
2. **Different release cadences** - Stable packages vs experimental packages
|
|
945
|
-
3. **Different registries** - Public npm vs private registry
|
|
946
|
-
4. **Different package groups** - Apps vs libraries vs tools
|
|
947
|
-
|
|
948
|
-
### How to Create Multiple Configs
|
|
949
|
-
|
|
950
|
-
Create multiple configuration files following this naming pattern: `<name>.config.<ext>`
|
|
951
|
-
|
|
952
|
-
**Example file structure:**
|
|
953
|
-
|
|
954
|
-
```text
|
|
955
|
-
/
|
|
956
|
-
├── relizy.config.ts # Main config (core packages)
|
|
957
|
-
├── relizy.standalone.config.ts # Standalone utilities config
|
|
958
|
-
└── relizy.experimental.config.json # Experimental packages config
|
|
959
|
-
```
|
|
960
|
-
|
|
961
|
-
You can use any supported format (`.ts`, `.js`, `.json`, `.yaml`, etc.) for each config file.
|
|
962
|
-
|
|
963
|
-
### Example: Core UI Packages vs Standalone Utilities
|
|
964
|
-
|
|
965
|
-
This is a real-world example where you want to separate UI components (which should be released together) from standalone utilities (which can evolve independently).
|
|
966
|
-
|
|
967
|
-
**`relizy.config.ts`** - Core UI packages (selective mode):
|
|
968
|
-
|
|
969
|
-
```typescript
|
|
970
|
-
import { defineConfig } from 'relizy'
|
|
971
|
-
|
|
972
|
-
export default defineConfig({
|
|
973
|
-
types: {
|
|
974
|
-
feat: { title: '🚀 Features', semver: 'minor' },
|
|
975
|
-
fix: { title: '🩹 Fixes', semver: 'patch' },
|
|
976
|
-
},
|
|
977
|
-
monorepo: {
|
|
978
|
-
versionMode: 'selective',
|
|
979
|
-
packages: [
|
|
980
|
-
'packages/lib',
|
|
981
|
-
'packages/icons',
|
|
982
|
-
'packages/themes',
|
|
983
|
-
'packages/nuxt',
|
|
984
|
-
'packages/translations',
|
|
985
|
-
],
|
|
986
|
-
},
|
|
987
|
-
templates: {
|
|
988
|
-
commitMessage: 'chore(release): v{{newVersion}}',
|
|
989
|
-
},
|
|
990
|
-
})
|
|
991
|
-
```
|
|
992
|
-
|
|
993
|
-
**`relizy.standalone.config.ts`** - Standalone utilities (independent mode):
|
|
994
|
-
|
|
995
|
-
```typescript
|
|
996
|
-
import { defineConfig } from 'relizy'
|
|
997
|
-
|
|
998
|
-
export default defineConfig({
|
|
999
|
-
types: {
|
|
1000
|
-
feat: { title: '🚀 Features', semver: 'minor' },
|
|
1001
|
-
fix: { title: '🩹 Fixes', semver: 'patch' },
|
|
1002
|
-
},
|
|
1003
|
-
monorepo: {
|
|
1004
|
-
versionMode: 'independent',
|
|
1005
|
-
packages: [
|
|
1006
|
-
'packages/utils',
|
|
1007
|
-
'packages/node',
|
|
1008
|
-
'packages/changelogen-monorepo',
|
|
1009
|
-
'packages/eslint-config',
|
|
1010
|
-
],
|
|
1011
|
-
},
|
|
1012
|
-
templates: {
|
|
1013
|
-
commitMessage: 'chore(release): {{packageName}}@{{newVersion}}',
|
|
1014
|
-
},
|
|
1015
|
-
changelog: {
|
|
1016
|
-
rootChangelog: false, // No root changelog for independent packages
|
|
1017
|
-
},
|
|
1018
|
-
})
|
|
1019
|
-
```
|
|
1020
|
-
|
|
1021
|
-
### Usage with Multiple Configs
|
|
189
|
+
### Control What Runs
|
|
1022
190
|
|
|
1023
191
|
```bash
|
|
1024
|
-
#
|
|
1025
|
-
|
|
1026
|
-
# or explicitly
|
|
1027
|
-
pnpm relizy release --config relizy --patch
|
|
1028
|
-
|
|
1029
|
-
# Release standalone utilities independently
|
|
1030
|
-
pnpm relizy release --config relizy.standalone --patch
|
|
1031
|
-
|
|
1032
|
-
# You can also use different configs for different commands
|
|
1033
|
-
pnpm relizy bump --config relizy.standalone --minor
|
|
1034
|
-
pnpm relizy changelog --config relizy.standalone
|
|
1035
|
-
pnpm relizy publish --config relizy.standalone
|
|
1036
|
-
```
|
|
1037
|
-
|
|
1038
|
-
### Example: Different Registries
|
|
1039
|
-
|
|
1040
|
-
**`relizy.config.ts`** - Public packages (npm registry):
|
|
1041
|
-
|
|
1042
|
-
```typescript
|
|
1043
|
-
import { defineConfig } from 'relizy'
|
|
1044
|
-
|
|
1045
|
-
export default defineConfig({
|
|
1046
|
-
monorepo: {
|
|
1047
|
-
versionMode: 'selective',
|
|
1048
|
-
packages: ['packages/public/*'],
|
|
1049
|
-
},
|
|
1050
|
-
publish: {
|
|
1051
|
-
registry: 'https://registry.npmjs.org',
|
|
1052
|
-
access: 'public',
|
|
1053
|
-
},
|
|
1054
|
-
})
|
|
1055
|
-
```
|
|
1056
|
-
|
|
1057
|
-
**`relizy.private.config.ts`** - Private packages (GitHub Packages):
|
|
1058
|
-
|
|
1059
|
-
```typescript
|
|
1060
|
-
import { defineConfig } from 'relizy'
|
|
1061
|
-
|
|
1062
|
-
export default defineConfig({
|
|
1063
|
-
monorepo: {
|
|
1064
|
-
versionMode: 'independent',
|
|
1065
|
-
packages: ['packages/private/*'],
|
|
1066
|
-
},
|
|
1067
|
-
publish: {
|
|
1068
|
-
registry: 'https://npm.pkg.github.com',
|
|
1069
|
-
access: 'restricted',
|
|
1070
|
-
},
|
|
1071
|
-
})
|
|
1072
|
-
```
|
|
192
|
+
# Skip git push
|
|
193
|
+
relizy release --patch --no-push
|
|
1073
194
|
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
pnpm relizy publish
|
|
195
|
+
# Skip GitHub/GitLab release
|
|
196
|
+
relizy release --patch --no-provider-release
|
|
1077
197
|
|
|
1078
|
-
#
|
|
1079
|
-
|
|
198
|
+
# Just bump and commit
|
|
199
|
+
relizy release --patch --no-publish --no-push
|
|
1080
200
|
```
|
|
1081
201
|
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
1. **Use descriptive config names** - `relizy.standalone.config.ts` is better than `relizy.alt.config.ts`
|
|
1085
|
-
2. **Document your workflow** - Add comments in your config files explaining the purpose
|
|
1086
|
-
3. **Keep it simple** - Don't create too many configs unless necessary
|
|
1087
|
-
4. **Version control** - Commit all config files to your repository
|
|
1088
|
-
5. **CI/CD integration** - Use different configs in different CI jobs if needed
|
|
1089
|
-
|
|
1090
|
-
### Tips
|
|
1091
|
-
|
|
1092
|
-
- The default config is `relizy.config.<ext>` where c12 will auto-detect the extension (you don't need `--config` flag)
|
|
1093
|
-
- Config files must follow the pattern `<name>.config.<ext>` (c12 requirement)
|
|
1094
|
-
- Supported formats: `.ts`, `.js`, `.mjs`, `.cjs`, `.mts`, `.cts`, `.json`, `.jsonc`, `.json5`, `.yaml`, `.yml`, `.toml`
|
|
1095
|
-
- All commands support the `--config` option
|
|
1096
|
-
- You can combine `--config` with `--dry-run` to preview different workflows
|
|
1097
|
-
|
|
1098
|
-
## 🔗 Dependency Management
|
|
202
|
+
For detailed CLI reference, configuration options, and advanced features, check out the [full documentation](https://louismazel.github.io/relizy/).
|
|
1099
203
|
|
|
1100
|
-
|
|
204
|
+
## 🧑💻 Development & Contributing
|
|
1101
205
|
|
|
1102
|
-
###
|
|
1103
|
-
|
|
1104
|
-
**Automatic detection:**
|
|
1105
|
-
|
|
1106
|
-
- When package B is updated, all packages that depend on B are automatically identified
|
|
1107
|
-
- By default only `dependencies` are considered (not `devDependencies` or `peerDependencies`). You can change this behavior using the [dependencyTypes](#bump) option.
|
|
1108
|
-
- Transitive dependencies are handled: if A→B→C and C is updated, both B and A are bumped
|
|
1109
|
-
|
|
1110
|
-
**Bump types by mode:**
|
|
1111
|
-
|
|
1112
|
-
- **Selective/unified mode:** Dependent packages get the same unified version as the root
|
|
1113
|
-
- **Independent mode:** Dependent packages get a minimum `patch` bump (can be higher if they also have commits)
|
|
1114
|
-
|
|
1115
|
-
**Example:**
|
|
206
|
+
### Running Tests
|
|
1116
207
|
|
|
1117
208
|
```bash
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
- @maz-ui/components@2.0.0 (depends on @maz-ui/utils)
|
|
1121
|
-
- @maz-ui/forms@1.5.0 (depends on @maz-ui/components)
|
|
1122
|
-
|
|
1123
|
-
Commit: feat(utils): add new utility
|
|
209
|
+
# Run all tests
|
|
210
|
+
pnpm test:unit
|
|
1124
211
|
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
- @maz-ui/components: 2.0.0 → 2.0.1 (patch - dependency updated)
|
|
1128
|
-
- @maz-ui/forms: 1.5.0 → 1.5.1 (patch - transitive dependency)
|
|
212
|
+
# Run tests in watch mode
|
|
213
|
+
pnpm test:unit:watch
|
|
1129
214
|
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
- Root version: 2.0.0 → 2.1.0
|
|
215
|
+
# Run tests with coverage
|
|
216
|
+
pnpm test:unit:coverage
|
|
1133
217
|
```
|
|
1134
218
|
|
|
1135
|
-
|
|
219
|
+
### Code Coverage
|
|
1136
220
|
|
|
1137
|
-
|
|
221
|
+
This project uses [Codecov](https://codecov.io) to track code coverage. Coverage reports are automatically generated and uploaded when you push to `main` or `develop` branches, or when you create a pull request.
|
|
1138
222
|
|
|
1139
|
-
|
|
223
|
+
**Coverage Requirements:**
|
|
1140
224
|
|
|
1141
|
-
**
|
|
225
|
+
- **Overall project**: Coverage should not decrease by more than 0.5%
|
|
226
|
+
- **New code (patches)**: Must have at least 80% coverage
|
|
1142
227
|
|
|
1143
|
-
|
|
228
|
+
You can view detailed coverage reports on [Codecov](https://codecov.io/gh/LouisMazel/relizy).
|
|
1144
229
|
|
|
1145
|
-
|
|
1146
|
-
| --------------------------------------- | ------------------------------------------ |
|
|
1147
|
-
| `lerna version patch` | `relizy release --patch` |
|
|
1148
|
-
| `lerna version minor` | `relizy release --minor` |
|
|
1149
|
-
| `lerna version major` | `relizy release --major` |
|
|
1150
|
-
| `lerna version prerelease --preid beta` | `relizy release --prerelease --preid beta` |
|
|
1151
|
-
| `lerna publish from-package` | Not needed (use `pnpm publish -r`) |
|
|
1152
|
-
|
|
1153
|
-
### Migration from Lerna
|
|
1154
|
-
|
|
1155
|
-
1. Keep your existing `lerna.json` (optional)
|
|
1156
|
-
2. Create a `relizy.config.ts` with your versioning strategy
|
|
1157
|
-
3. Replace `lerna version` with `relizy release`
|
|
1158
|
-
4. Use your package manager to publish (e.g., `pnpm publish -r`)
|
|
1159
|
-
|
|
1160
|
-
## 🦊 GitLab CI/CD Configuration
|
|
1161
|
-
|
|
1162
|
-
### Personal Access Token
|
|
1163
|
-
|
|
1164
|
-
1. Go to GitLab → Settings → Access Tokens
|
|
1165
|
-
2. Create a token with `api` scope
|
|
1166
|
-
3. Set the environment variable:
|
|
230
|
+
To see coverage locally:
|
|
1167
231
|
|
|
1168
232
|
```bash
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
### CI/CD Pipeline
|
|
1173
|
-
|
|
1174
|
-
GitLab CI automatically provides `CI_JOB_TOKEN` which can be used for releases:
|
|
1175
|
-
|
|
1176
|
-
```yaml
|
|
1177
|
-
release:
|
|
1178
|
-
stage: deploy
|
|
1179
|
-
script:
|
|
1180
|
-
- pnpm install
|
|
1181
|
-
- pnpm relizy release --yes
|
|
1182
|
-
only:
|
|
1183
|
-
- main
|
|
233
|
+
pnpm test:unit:coverage
|
|
234
|
+
# Open coverage/index.html in your browser
|
|
1184
235
|
```
|
|
1185
236
|
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
You can also use the tool programmatically:
|
|
1189
|
-
|
|
1190
|
-
```typescript
|
|
1191
|
-
import {
|
|
1192
|
-
bump,
|
|
1193
|
-
changelog,
|
|
1194
|
-
providerRelease,
|
|
1195
|
-
publish,
|
|
1196
|
-
release,
|
|
1197
|
-
} from 'relizy'
|
|
1198
|
-
|
|
1199
|
-
// Bump versions
|
|
1200
|
-
await bump({
|
|
1201
|
-
type: 'prerelease',
|
|
1202
|
-
preid: 'beta',
|
|
1203
|
-
})
|
|
237
|
+
### Pull Request Guidelines
|
|
1204
238
|
|
|
1205
|
-
|
|
1206
|
-
await changelog({
|
|
1207
|
-
from: 'v1.0.0',
|
|
1208
|
-
to: 'v1.1.0',
|
|
1209
|
-
})
|
|
239
|
+
When submitting a PR:
|
|
1210
240
|
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
241
|
+
1. Ensure all tests pass (`pnpm test:unit`)
|
|
242
|
+
2. Check TypeScript types (`pnpm typecheck`)
|
|
243
|
+
3. Lint your code (`pnpm lint`)
|
|
244
|
+
4. Add tests for new features
|
|
245
|
+
5. Maintain or improve code coverage (Codecov will comment on your PR)
|
|
1216
246
|
|
|
1217
|
-
|
|
1218
|
-
// Git provider is detected automatically but you can also specify it explicitly
|
|
1219
|
-
await providerRelease({
|
|
1220
|
-
provider: 'github',
|
|
1221
|
-
})
|
|
247
|
+
The Codecov bot will automatically comment on your PR with coverage details and changes.
|
|
1222
248
|
|
|
1223
|
-
|
|
1224
|
-
await release({
|
|
1225
|
-
type: 'prerelease',
|
|
1226
|
-
preid: 'beta',
|
|
1227
|
-
tag: 'beta',
|
|
1228
|
-
registry: 'https://registry.npmjs.org',
|
|
1229
|
-
push: true,
|
|
1230
|
-
release: true,
|
|
1231
|
-
publish: true,
|
|
1232
|
-
})
|
|
1233
|
-
```
|
|
249
|
+
For detailed contribution guidelines, including development setup, testing workflows, commit conventions, and the complete PR process, please read our **[Contributing Guide](CONTRIBUTING.md)**.
|
|
1234
250
|
|
|
1235
251
|
## License
|
|
1236
252
|
|