@muverse/cli 0.1.4 → 0.1.5
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 +365 -8
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,22 +1,379 @@
|
|
|
1
|
-
# @muverse/cli
|
|
1
|
+
# @muverse/cli - Command-Line Interface
|
|
2
2
|
|
|
3
|
-
Command-line interface for
|
|
3
|
+
Command-line interface for μVERSE (Version Engine for Repo Semantic Evolution). This CLI provides all the power of μVERSE's semantic versioning engine through an easy-to-use command-line tool, perfect for local development and custom CI/CD systems.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Global Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g @muverse/cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### Local Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install --save-dev @muverse/cli
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Using npx (no installation)
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
px @muverse/cli
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
### Basic Usage
|
|
28
|
+
|
|
29
|
+
Navigate to your project root and run:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
muverse
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
This will:
|
|
36
|
+
1. Detect your project type (Gradle, etc.)
|
|
37
|
+
2. Analyze commits since the last version
|
|
38
|
+
3. Calculate version bumps based on Conventional Commits
|
|
39
|
+
4. Update version files
|
|
40
|
+
5. Generate changelogs
|
|
41
|
+
6. Create git commits and tags
|
|
42
|
+
7. Push changes to remote
|
|
43
|
+
|
|
44
|
+
### Dry Run
|
|
45
|
+
|
|
46
|
+
Preview what would happen without making changes:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
muverse --dry-run
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Specify Project Root
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
muverse /path/to/project
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Specify Adapter
|
|
59
|
+
|
|
60
|
+
If auto-detection fails or you want to be explicit:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
muverse --adapter gradle
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Command Reference
|
|
67
|
+
|
|
68
|
+
### `muverse [REPOSITORYROOT]`
|
|
69
|
+
|
|
70
|
+
Calculate and apply semantic version changes.
|
|
71
|
+
|
|
72
|
+
**Arguments:**
|
|
73
|
+
- `REPOSITORYROOT` - Path to the repository root (default: `.`)
|
|
74
|
+
|
|
75
|
+
**Flags:**
|
|
76
|
+
|
|
77
|
+
| Flag | Description | Default |
|
|
78
|
+
|------|-------------|---------|
|
|
79
|
+
| `--dry-run` | Run without writing or pushing changes | `false` |
|
|
80
|
+
| `--adapter <value>` | Language adapter (e.g., gradle). Auto-detected if not provided | - |
|
|
81
|
+
| `--push-tags` | Push tags to origin | `true` |
|
|
82
|
+
| `--no-push-tags` | Don't push tags to origin | - |
|
|
83
|
+
| `--prerelease-mode` | Generate pre-release versions instead of final versions | `false` |
|
|
84
|
+
| `--prerelease-id <value>` | Pre-release identifier (e.g., alpha, beta, rc) | `alpha` |
|
|
85
|
+
| `--bump-unchanged` | In prerelease mode, bump modules even when no changes are detected | `false` |
|
|
86
|
+
| `--add-build-metadata` | Add build metadata with short SHA to all versions | `false` |
|
|
87
|
+
| `--timestamp-versions` | Use timestamp-based prerelease identifiers (requires prerelease-mode) | `false` |
|
|
88
|
+
| `--append-snapshot` | Add -SNAPSHOT suffix to all versions if supported by adapter | `false` |
|
|
89
|
+
| `--push-changes` | Commit and push version changes and changelogs to remote | `true` |
|
|
90
|
+
| `--no-push-changes` | Don't commit and push changes | - |
|
|
91
|
+
| `--generate-changelog` | Generate or update changelog files for changed modules | `true` |
|
|
92
|
+
| `--no-generate-changelog` | Don't generate changelogs | - |
|
|
93
|
+
|
|
94
|
+
> 📖 **Detailed Pre-release Documentation**: See [@muverse/core PRERELEASE.md](../core/PRERELEASE.md) for comprehensive examples and use cases.
|
|
95
|
+
|
|
96
|
+
## Examples
|
|
97
|
+
|
|
98
|
+
### Release Version
|
|
99
|
+
|
|
100
|
+
Apply semantic versions based on commits:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
muverse
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Pre-release Versions
|
|
107
|
+
|
|
108
|
+
Generate beta pre-release versions:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
muverse --prerelease-mode --prerelease-id beta
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Timestamp Versions
|
|
115
|
+
|
|
116
|
+
Generate timestamp-based pre-release versions for CI builds:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
muverse --prerelease-mode --prerelease-id alpha --timestamp-versions --add-build-metadata
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
This generates versions like: `1.2.3-alpha.20251208.1530+abc1234`
|
|
123
|
+
|
|
124
|
+
### Gradle SNAPSHOT Versions
|
|
125
|
+
|
|
126
|
+
Generate Gradle SNAPSHOT versions:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
muverse --append-snapshot
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Development Workflow
|
|
133
|
+
|
|
134
|
+
Bump all modules (even unchanged) for development:
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
muverse --prerelease-mode --bump-unchanged
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Local Testing
|
|
141
|
+
|
|
142
|
+
Test without committing or pushing:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
muverse --dry-run --no-push-changes --no-push-tags
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Manual Git Operations
|
|
149
|
+
|
|
150
|
+
Calculate versions without automatic git operations:
|
|
6
151
|
|
|
7
152
|
```bash
|
|
8
|
-
|
|
153
|
+
muverse --no-push-changes --no-push-tags
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Then manually review, commit, and push.
|
|
157
|
+
|
|
158
|
+
## Configuration
|
|
159
|
+
|
|
160
|
+
μVERSE CLI uses the same configuration system as the core library. Configuration files are automatically detected in your repository root.
|
|
161
|
+
|
|
162
|
+
### Supported Configuration Files
|
|
163
|
+
|
|
164
|
+
1. `package.json` (in a `"muverse"` property)
|
|
165
|
+
2. `.muverserc` (JSON or YAML)
|
|
166
|
+
3. `.muverserc.json`
|
|
167
|
+
4. `.muverserc.yaml` / `.muverserc.yml`
|
|
168
|
+
5. `.muverserc.js` (JavaScript)
|
|
169
|
+
6. `muverse.config.js` (JavaScript)
|
|
170
|
+
|
|
171
|
+
### Configuration Example
|
|
172
|
+
|
|
173
|
+
`.muverserc.json`:
|
|
174
|
+
```json
|
|
175
|
+
{
|
|
176
|
+
"defaultBump": "patch",
|
|
177
|
+
"commitTypes": {
|
|
178
|
+
"feat": "minor",
|
|
179
|
+
"fix": "patch",
|
|
180
|
+
"perf": "patch",
|
|
181
|
+
"refactor": "patch",
|
|
182
|
+
"docs": "ignore",
|
|
183
|
+
"test": "ignore",
|
|
184
|
+
"chore": "ignore"
|
|
185
|
+
},
|
|
186
|
+
"dependencyRules": {
|
|
187
|
+
"onMajorOfDependency": "minor",
|
|
188
|
+
"onMinorOfDependency": "patch",
|
|
189
|
+
"onPatchOfDependency": "none"
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
For more configuration examples, see the [core package documentation](../core).
|
|
195
|
+
|
|
196
|
+
## Gradle Project Support
|
|
197
|
+
|
|
198
|
+
The CLI supports Gradle projects with:
|
|
199
|
+
|
|
200
|
+
- **Multi-module projects** via `settings.gradle(.kts)`
|
|
201
|
+
- **Version management** through root `gradle.properties` file
|
|
202
|
+
- **Dependency detection** via custom Gradle init script
|
|
203
|
+
- **Both DSLs**: Groovy and Kotlin
|
|
204
|
+
|
|
205
|
+
### Example Project Structure
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
myproject/
|
|
209
|
+
├── settings.gradle.kts
|
|
210
|
+
├── build.gradle.kts
|
|
211
|
+
├── gradle.properties # All module versions defined here
|
|
212
|
+
├── core/
|
|
213
|
+
│ └── build.gradle.kts
|
|
214
|
+
└── api/
|
|
215
|
+
└── build.gradle.kts
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Example `gradle.properties`
|
|
219
|
+
|
|
220
|
+
```properties
|
|
221
|
+
# Root module version
|
|
222
|
+
version=1.0.0
|
|
223
|
+
|
|
224
|
+
# Submodule versions
|
|
225
|
+
core.version=2.1.0
|
|
226
|
+
api.version=1.5.0
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## Commit Message Format
|
|
230
|
+
|
|
231
|
+
μVERSE uses [Conventional Commits](https://conventionalcommits.org/) to determine version bumps:
|
|
232
|
+
|
|
233
|
+
```
|
|
234
|
+
<type>[optional scope]: <description>
|
|
235
|
+
|
|
236
|
+
[optional body]
|
|
237
|
+
|
|
238
|
+
[optional footer(s)]
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**Examples:**
|
|
242
|
+
- `feat(api): add new endpoint` → **minor** bump
|
|
243
|
+
- `fix(core): resolve memory leak` → **patch** bump
|
|
244
|
+
- `feat!: breaking API change` → **major** bump
|
|
245
|
+
|
|
246
|
+
### Breaking Changes
|
|
247
|
+
|
|
248
|
+
Breaking changes trigger **major** version bumps:
|
|
249
|
+
|
|
250
|
+
1. Using `!` after the type: `feat!: remove deprecated API`
|
|
251
|
+
2. Using `BREAKING CHANGE:` in the footer:
|
|
252
|
+
```
|
|
253
|
+
feat: update API
|
|
254
|
+
|
|
255
|
+
BREAKING CHANGE: The old API is removed
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## CI/CD Integration
|
|
259
|
+
|
|
260
|
+
### GitHub Actions
|
|
261
|
+
|
|
262
|
+
```yaml
|
|
263
|
+
- name: Install μVERSE CLI
|
|
264
|
+
run: npm install -g @muverse/cli
|
|
265
|
+
|
|
266
|
+
- name: Version modules
|
|
267
|
+
run: muverse --adapter gradle
|
|
9
268
|
```
|
|
10
269
|
|
|
11
|
-
|
|
270
|
+
### GitLab CI
|
|
271
|
+
|
|
272
|
+
```yaml
|
|
273
|
+
version:
|
|
274
|
+
script:
|
|
275
|
+
- npm install -g @muverse/cli
|
|
276
|
+
- muverse --adapter gradle
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Jenkins
|
|
280
|
+
|
|
281
|
+
```groovy
|
|
282
|
+
stage('Version') {
|
|
283
|
+
steps {
|
|
284
|
+
sh 'npm install -g @muverse/cli'
|
|
285
|
+
sh 'muverse --adapter gradle'
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### Local Development
|
|
291
|
+
|
|
292
|
+
Add to your `package.json`:
|
|
293
|
+
|
|
294
|
+
```json
|
|
295
|
+
{
|
|
296
|
+
"scripts": {
|
|
297
|
+
"version": "muverse --dry-run",
|
|
298
|
+
"version:release": "muverse"
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
Then run:
|
|
304
|
+
```bash
|
|
305
|
+
npm run version # Dry run
|
|
306
|
+
npm run version:release # Actual release
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
## Troubleshooting
|
|
310
|
+
|
|
311
|
+
### Command Not Found
|
|
312
|
+
|
|
313
|
+
If `muverse` is not found after global installation:
|
|
314
|
+
|
|
315
|
+
1. Check npm global bin path: `npm bin -g`
|
|
316
|
+
2. Ensure it's in your PATH
|
|
317
|
+
3. Try using npx: `npx @muverse/cli`
|
|
318
|
+
|
|
319
|
+
### Permission Denied on Push
|
|
320
|
+
|
|
321
|
+
If you get permission errors when pushing:
|
|
322
|
+
|
|
323
|
+
1. Ensure you have proper git credentials configured
|
|
324
|
+
2. Check if you have write access to the repository
|
|
325
|
+
3. Use `--no-push-changes --no-push-tags` to skip git operations
|
|
326
|
+
|
|
327
|
+
### No Version Bump Detected
|
|
328
|
+
|
|
329
|
+
If versions aren't bumping:
|
|
330
|
+
|
|
331
|
+
1. Check commit messages follow Conventional Commits format
|
|
332
|
+
2. Verify you have commits since the last version
|
|
333
|
+
3. Check configuration if certain commit types are ignored
|
|
334
|
+
4. Use `--dry-run` to see what μVERSE detects
|
|
335
|
+
|
|
336
|
+
### Adapter Not Detected
|
|
337
|
+
|
|
338
|
+
If auto-detection fails:
|
|
339
|
+
|
|
340
|
+
1. Verify your project has the expected build files
|
|
341
|
+
2. Explicitly specify the adapter: `--adapter gradle`
|
|
342
|
+
3. Check if your project structure is supported
|
|
343
|
+
|
|
344
|
+
## Development
|
|
345
|
+
|
|
346
|
+
### Building from Source
|
|
12
347
|
|
|
13
348
|
```bash
|
|
14
|
-
#
|
|
15
|
-
|
|
349
|
+
# From monorepo root
|
|
350
|
+
npm install
|
|
351
|
+
npm run build
|
|
352
|
+
|
|
353
|
+
# Or from CLI package
|
|
354
|
+
cd packages/cli
|
|
355
|
+
npm install
|
|
356
|
+
npm run build
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
### Running Locally
|
|
360
|
+
|
|
361
|
+
```bash
|
|
362
|
+
# After building
|
|
363
|
+
node dist/index.js --dry-run
|
|
16
364
|
```
|
|
17
365
|
|
|
18
|
-
|
|
366
|
+
### Publishing
|
|
19
367
|
|
|
20
368
|
```bash
|
|
21
369
|
npm publish --workspace packages/cli --access public
|
|
22
370
|
```
|
|
371
|
+
|
|
372
|
+
## Related Packages
|
|
373
|
+
|
|
374
|
+
- **[@muverse/core](../core)** - Core library for custom integrations
|
|
375
|
+
- **[@muverse/action](../action)** - GitHub Actions integration
|
|
376
|
+
|
|
377
|
+
## License
|
|
378
|
+
|
|
379
|
+
MIT License - see [LICENSE](../../LICENSE) for details.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@muverse/cli",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.5",
|
|
4
|
+
"description": "Version Engine for Repo Semantic Evolution (CLI)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"bin": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"types": "dist/index.d.ts",
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@oclif/core": "^4.8.0",
|
|
41
|
-
"@muverse/core": "^0.1.
|
|
41
|
+
"@muverse/core": "^0.1.5",
|
|
42
42
|
"oclif": "^4.14.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|