fireflyy 3.0.11 โ 4.0.0-dev.fd79cb3
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 +2 -418
- package/assets/firefly.schema.json +118 -112
- package/dist/dry-run-BfYCtldz.js +38 -0
- package/dist/filesystem.service-DdVwnqoa.js +57 -0
- package/dist/git.service-DarjfyXF.js +587 -0
- package/dist/index.d.ts +43 -23
- package/dist/index.js +20 -1
- package/dist/main.js +110 -16
- package/dist/package-json.service-QN7SzRTt.js +70 -0
- package/dist/program-DSPj4l5A.js +3457 -0
- package/dist/result.constructors-C9M1MP3_.js +261 -0
- package/dist/result.utilities-B03Jkhlx.js +32 -0
- package/dist/schema.utilities-BGd9t1wm.js +60 -0
- package/package.json +88 -84
package/README.md
CHANGED
|
@@ -1,419 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
Please visit [firefly/tree/v3](https://github.com/yehezkieldio/firefly/tree/v3) for the latest stable release.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
<p>Automatic semantic versioning, changelog generation, and creating GitHub releases via a CLI.</p>
|
|
5
|
-
|
|
6
|
-
</div>
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
Firefly is a Command Line Interface (CLI) tool designed to streamline and automate the entire release process of semantic versioning, changelog generation, and a GitHub release, ensuring consistent and efficient steps for me and possibly for you too. It is built on the principles of [Semantic Versioning](https://semver.org/) and [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) to deliver predictable versioning and clear, structured commit history for any project.
|
|
11
|
-
|
|
12
|
-
**How It Works:**
|
|
13
|
-
|
|
14
|
-
- Runs preflight checks to ensure a safe environment
|
|
15
|
-
- Determines the next version automatically from commit history or via manual selection
|
|
16
|
-
- Bumps the version in `package.json`
|
|
17
|
-
- Generates changelogs with [git-cliff](https://github.com/orhun/git-cliff)
|
|
18
|
-
- Commits the changes and creates a Git tag
|
|
19
|
-
- Pushes the changes to the remote repository
|
|
20
|
-
- Creates a GitHub release with the generated changelog via GitHub CLI
|
|
21
|
-
|
|
22
|
-
## Getting Started
|
|
23
|
-
|
|
24
|
-
#### Prerequisites
|
|
25
|
-
|
|
26
|
-
Firefly requires [Bun](https://bun.sh/) and the [GitHub CLI](https://cli.github.com/) installed and authenticated.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
#### Per-Project Installation
|
|
30
|
-
|
|
31
|
-
For project-specific installations, add Firefly as a development dependency:
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
bun add -D fireflyy
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
#### Global Installation
|
|
38
|
-
|
|
39
|
-
For system-wide access across multiple projects:
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
bun install -g fireflyy
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### Usage
|
|
46
|
-
|
|
47
|
-
#### The release Command
|
|
48
|
-
|
|
49
|
-
Firefly consolidates the entire release steps into a single command that orchestrates version bumping, changelog generation, and GitHub release creation.
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
firefly release
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
#### Inference and Overrides
|
|
56
|
-
|
|
57
|
-
By default, Firefly intelligently infers project details from your environment:
|
|
58
|
-
|
|
59
|
-
- **Project name**: Extracted from `package.json` name field
|
|
60
|
-
- **Repository**: Detected from Git remote origin URL
|
|
61
|
-
- **Changelog path**: Defaults to `CHANGELOG.md` in the project root
|
|
62
|
-
- **Current version**: Read from `package.json` version field
|
|
63
|
-
- **Scope**: Automatically parsed from scoped package names
|
|
64
|
-
- **Branch**: Current Git branch
|
|
65
|
-
|
|
66
|
-
These inferred values provide sensible defaults but can be overridden through CLI flags or from the configuration file.
|
|
67
|
-
|
|
68
|
-
#### Command Line Options Reference
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
Usage: firefly release [options]
|
|
72
|
-
|
|
73
|
-
Bump a new version, generate a changelog, and publish the release.
|
|
74
|
-
|
|
75
|
-
Options:
|
|
76
|
-
--ci Run in CI environment.
|
|
77
|
-
--repository <repository> Repo in 'owner/repo' format, auto-detected if omitted. (default: "")
|
|
78
|
-
--verbose Enable verbose logging.
|
|
79
|
-
--dry-run Simulate execution without changes.
|
|
80
|
-
--branch <branch> Branch to run on, defaults to current.
|
|
81
|
-
--name <name> Unscoped project name. Auto-detected from package.json.
|
|
82
|
-
--scope <scope> Org/user scope without "@". Auto-detected from package.json.
|
|
83
|
-
--base <base> Relative path from repository root to project root. Useful for monorepos. (default: "")
|
|
84
|
-
--changelog-path <changelog-path> Changelog file path, relative to project root. (default: "CHANGELOG.md")
|
|
85
|
-
--bump-strategy <bump-strategy> "auto" (from commits) or "manual" (user-specified). (default: "")
|
|
86
|
-
--release-type <release-type> The release type to bump.
|
|
87
|
-
--pre-release-id <pre-release-id> Pre-release ID (e.g., "alpha", "beta"). (default: "alpha")
|
|
88
|
-
--pre-release-base <pre-release-base> Starting version for pre-releases.
|
|
89
|
-
--release-notes <release-notes> Custom release notes for changelog. (default: "")
|
|
90
|
-
--commit-message <commit-message> Commit message template with placeholders. (default: "chore(release): release {{name}}@{{version}}")
|
|
91
|
-
--tag-name <tag-name> Tag name template with placeholders. (default: "{{name}}@{{version}}")
|
|
92
|
-
--skip-bump Skip version bump step.
|
|
93
|
-
--skip-changelog Skip changelog generation step.
|
|
94
|
-
--skip-push Skip push step.
|
|
95
|
-
--skip-github-release Skip GitHub release step.
|
|
96
|
-
--skip-git Skip all git-related steps.
|
|
97
|
-
--skip-preflight-check Skip preflight checks.
|
|
98
|
-
--release-title <release-title> GitHub release title with placeholders. (default: "{{name}}@{{version}}")
|
|
99
|
-
--release-latest Mark as latest release.
|
|
100
|
-
--release-pre-release Mark as pre-release.
|
|
101
|
-
--release-draft Release as draft version.
|
|
102
|
-
-h, --help display help for command
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
#### Version Bumping Strategies
|
|
106
|
-
|
|
107
|
-
Firefly offers two primary strategies for version determination.
|
|
108
|
-
|
|
109
|
-
##### Automatic Strategy (`--bump-strategy auto`)
|
|
110
|
-
|
|
111
|
-
The automatic strategy analyzes your commit history using conventional commit standards to determine the appropriate version increment.
|
|
112
|
-
|
|
113
|
-
**How It Works:**
|
|
114
|
-
|
|
115
|
-
Firefly's automatic versioning follows a three-stage process:
|
|
116
|
-
|
|
117
|
-
1. Fetches all commits since the last Git tag (or all commits if no tags exist)
|
|
118
|
-
2. Parses each commit using conventional commit patterns to extract type, scope, and breaking change indicators
|
|
119
|
-
3. Determines the appropriate version level based on the highest-impact change detected
|
|
120
|
-
|
|
121
|
-
**Version Level Determination:**
|
|
122
|
-
|
|
123
|
-
The system prioritizes changes in the following hierarchy:
|
|
124
|
-
|
|
125
|
-
- **MAJOR (0)**: Breaking changes take absolute precedence
|
|
126
|
-
- Commits with `BREAKING CHANGE:` footer
|
|
127
|
-
- Commits with `!` after type/scope (e.g., `feat!:`, `fix(api)!:`)
|
|
128
|
-
- Scoped breaking changes
|
|
129
|
-
|
|
130
|
-
- **MINOR (1)**: New features when no breaking changes exist
|
|
131
|
-
- `feat:` commit types
|
|
132
|
-
|
|
133
|
-
- **PATCH (2)**: Bug fixes and maintenance when no features or breaking changes exist
|
|
134
|
-
- `fix:`, `perf:`, `refactor:`, `style:`, `test:`, `build:`, `ci:`, `chore:`, `docs:`, `security:`
|
|
135
|
-
|
|
136
|
-
**Commit Analysis:**
|
|
137
|
-
|
|
138
|
-
The analyzer performs deep inspection of commit metadata:
|
|
139
|
-
|
|
140
|
-
- Scans commit headers, bodies, and footers for breaking change indicators
|
|
141
|
-
- Identifies commits indicating graduation from pre-release to stable versions
|
|
142
|
-
- Properly categorizes revert commits based on what they're reverting
|
|
143
|
-
|
|
144
|
-
**Repository State Handling:**
|
|
145
|
-
|
|
146
|
-
- When no Git tags exist, Firefly can either analyze all commits or default to patch increment
|
|
147
|
-
- If no commits exist since the last tag, defaults to patch increment for safety
|
|
148
|
-
- Always selects the highest-impact change (breaking > feature > patch)
|
|
149
|
-
|
|
150
|
-
> [!NOTE]
|
|
151
|
-
> Analyzer customization is planned for future releases, allowing tailored commit parsing rules and more.
|
|
152
|
-
|
|
153
|
-
##### Manual Strategy (`--bump-strategy manual`)
|
|
154
|
-
|
|
155
|
-
The manual strategy presents you with a generated list of potential version increments based on your current version.
|
|
156
|
-
|
|
157
|
-
<!-- ```bash
|
|
158
|
-
โฏ Select version bump
|
|
159
|
-
โ prerelease (3.0.0-alpha.21)
|
|
160
|
-
โ graduate (3.0.0)
|
|
161
|
-
โ patch (3.0.1)
|
|
162
|
-
โ minor (3.1.0)
|
|
163
|
-
โ major (4.0.0)
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
You can bypass the prompt by specifying the desired release type directly:
|
|
167
|
-
|
|
168
|
-
```bash
|
|
169
|
-
firefly release --release-type minor # 1.0.0 โ 1.1.0
|
|
170
|
-
``` -->
|
|
171
|
-
|
|
172
|
-
- **Prompt**: Interactive selection of the desired version bump
|
|
173
|
-
```bash
|
|
174
|
-
โฏ Select version bump
|
|
175
|
-
โ prerelease (3.0.0-alpha.21)
|
|
176
|
-
โ graduate (3.0.0)
|
|
177
|
-
โ patch (3.0.1)
|
|
178
|
-
โ minor (3.1.0)
|
|
179
|
-
โ major (4.0.0)
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
- **Direct Specification**: Use `--release-type` to specify the desired bump directly
|
|
183
|
-
```bash
|
|
184
|
-
firefly release --release-type minor # 1.0.0 โ 1.1.0
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
##### Bumping Pre-Release Versions
|
|
188
|
-
|
|
189
|
-
Firefly supports comprehensive pre-release versioning for testing and staging workflows.
|
|
190
|
-
|
|
191
|
-
Pre-release versions follow the pattern `major.minor.patch-identifier.number`:
|
|
192
|
-
|
|
193
|
-
**Pre-release Types:**
|
|
194
|
-
- **premajor**: `1.0.0 โ 2.0.0-alpha.0`
|
|
195
|
-
- **preminor**: `1.0.0 โ 1.1.0-alpha.0`
|
|
196
|
-
- **prepatch**: `1.0.0 โ 1.0.1-alpha.0`
|
|
197
|
-
- **prerelease**: `1.0.0-alpha.0 โ 1.0.0-alpha.1`
|
|
198
|
-
|
|
199
|
-
**Customizing Pre-release Identifiers:**
|
|
200
|
-
|
|
201
|
-
The default pre-release identifier is `alpha`, but you can customize it using `--pre-release-id`:
|
|
202
|
-
|
|
203
|
-
```bash
|
|
204
|
-
firefly release --bump-strategy manual --release-type preminor --pre-release-id beta
|
|
205
|
-
# Result: 1.0.0 โ 1.1.0-beta.0
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
**Pre-release Base Numbering:**
|
|
209
|
-
|
|
210
|
-
Use `--pre-release-base` to control the starting number for pre-releases (defaults to 0):
|
|
211
|
-
|
|
212
|
-
```bash
|
|
213
|
-
firefly release --release-type prepatch --pre-release-id rc --pre-release-base 1
|
|
214
|
-
# Result: 1.0.0 โ 1.0.1-rc.1
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
## Configuration & Customization
|
|
218
|
-
|
|
219
|
-
### The Configuration File
|
|
220
|
-
|
|
221
|
-
Firefly's configuration system centers around the `firefly.config.ts` file, that should be placed at the root of your project. By default, Firefly doesn't require a configuration file, but it can be used to customize behavior and defaults.
|
|
222
|
-
|
|
223
|
-
#### Basic Configuration Structure
|
|
224
|
-
|
|
225
|
-
```ts
|
|
226
|
-
export default {
|
|
227
|
-
// Basic project information
|
|
228
|
-
name: "my-awesome-package",
|
|
229
|
-
scope: "myorg",
|
|
230
|
-
|
|
231
|
-
// Versioning strategy
|
|
232
|
-
bumpStrategy: "auto",
|
|
233
|
-
|
|
234
|
-
// Template customization
|
|
235
|
-
commitMessage: "chore(release): release {{name}}@{{version}}",
|
|
236
|
-
tagName: "v{{version}}",
|
|
237
|
-
releaseTitle: "{{name}} v{{version}}",
|
|
238
|
-
};
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
#### Project Name and Scope
|
|
242
|
-
|
|
243
|
-
The `name` and `scope` configuration options provide fine-grained control over how Firefly identifies and names your project:
|
|
244
|
-
|
|
245
|
-
**Automatic Detection:**
|
|
246
|
-
|
|
247
|
-
```json
|
|
248
|
-
// package.json
|
|
249
|
-
{
|
|
250
|
-
"name": "@myorg/awesome-package"
|
|
251
|
-
}
|
|
252
|
-
```
|
|
253
|
-
Firefly automatically extracts `scope: "myorg"` and `name: "awesome-package"`.
|
|
254
|
-
|
|
255
|
-
**Override for Unscoped Releases:**
|
|
256
|
-
|
|
257
|
-
```ts
|
|
258
|
-
export default {
|
|
259
|
-
name: "awesome-package",
|
|
260
|
-
scope: "", // Explicitly disable scope
|
|
261
|
-
};
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
**Custom Naming for Monorepos:**
|
|
265
|
-
|
|
266
|
-
```ts
|
|
267
|
-
// packages/languages/firefly.config.ts
|
|
268
|
-
export default {
|
|
269
|
-
name: "languages",
|
|
270
|
-
scope: "project-imperia",
|
|
271
|
-
base: "packages/languages", // Path from repo root
|
|
272
|
-
};
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
#### Templating for Release Artifacts
|
|
276
|
-
|
|
277
|
-
Firefly's templating system enables dynamic content generation across commit messages, tag names, and release titles.
|
|
278
|
-
|
|
279
|
-
Templates use double-brace syntax and support several powerful variables:
|
|
280
|
-
|
|
281
|
-
##### Available Template Variables
|
|
282
|
-
|
|
283
|
-
- `{{name}}`: The complete project name, including scope if present (`@myorg/package` or `package`)
|
|
284
|
-
- `{{unscopedName}}`: The project name without scope (`package`)
|
|
285
|
-
- `{{version}}`: The new version being released (`1.2.0`)
|
|
286
|
-
|
|
287
|
-
##### Customizing Commit Messages
|
|
288
|
-
|
|
289
|
-
Default: `"chore(release): release {{name}}@{{version}}"`
|
|
290
|
-
|
|
291
|
-
```ts
|
|
292
|
-
export default {
|
|
293
|
-
commitMessage: "chore: bump {{name}} version {{version}}",
|
|
294
|
-
// Result: "chore: bump @myorg/package version 1.2.0"
|
|
295
|
-
};
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
##### Customizing Tag Names
|
|
299
|
-
|
|
300
|
-
Default: `"{{name}}@{{version}}"`
|
|
301
|
-
|
|
302
|
-
```ts
|
|
303
|
-
export default {
|
|
304
|
-
tagName: "v{{version}}", // Simple semantic versioning tags
|
|
305
|
-
// Result: "v1.2.0"
|
|
306
|
-
|
|
307
|
-
// Or for scoped packages:
|
|
308
|
-
tagName: "{{unscopedName}}-{{version}}",
|
|
309
|
-
// Result: "package-1.2.0"
|
|
310
|
-
};
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
##### Customizing Release Titles
|
|
314
|
-
|
|
315
|
-
Default: `"{{name}}@{{version}}"`
|
|
316
|
-
|
|
317
|
-
```ts
|
|
318
|
-
export default {
|
|
319
|
-
releaseTitle: "Release {{unscopedName}} {{version}}",
|
|
320
|
-
// Result: "Release package 1.2.0"
|
|
321
|
-
};
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
##### Customizing Release Notes
|
|
325
|
-
|
|
326
|
-
```ts
|
|
327
|
-
export default {
|
|
328
|
-
releaseNotes: "This release includes important updates to {{unscopedName}}. See changelog for details.",
|
|
329
|
-
};
|
|
330
|
-
```
|
|
331
|
-
|
|
332
|
-
Or `--release-notes` flag to provide custom release notes directly via CLI.
|
|
333
|
-
|
|
334
|
-
> See [git-cliff > Adding Tag Messages](https://git-cliff.org/docs/usage/adding-tag-messages/) on how to include release notes in the changelog.
|
|
335
|
-
|
|
336
|
-
#### Skipping Release Steps
|
|
337
|
-
|
|
338
|
-
Firefly provides granular control over which steps to execute, enabling flexible workflows for different scenarios:
|
|
339
|
-
|
|
340
|
-
**Common Skip Patterns:**
|
|
341
|
-
|
|
342
|
-
```bash
|
|
343
|
-
# Skip changelog
|
|
344
|
-
firefly release --skip-changelog
|
|
345
|
-
|
|
346
|
-
# Skip GitHub release
|
|
347
|
-
firefly release --skip-github-release
|
|
348
|
-
|
|
349
|
-
# Dry run to preview changes
|
|
350
|
-
firefly release --dry-run
|
|
351
|
-
```
|
|
352
|
-
|
|
353
|
-
### Integrating with git-cliff
|
|
354
|
-
|
|
355
|
-
Firefly leverages git-cliff's powerful changelog generation capabilities while respecting your existing configuration.
|
|
356
|
-
|
|
357
|
-
**Configuration Discovery**
|
|
358
|
-
|
|
359
|
-
Firefly automatically locates `cliff.toml` at the root of your project.
|
|
360
|
-
|
|
361
|
-
**Basic cliff.toml for conventional commits:**
|
|
362
|
-
|
|
363
|
-
```toml
|
|
364
|
-
[changelog]
|
|
365
|
-
body = """
|
|
366
|
-
{% if version %}\
|
|
367
|
-
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
|
|
368
|
-
{% else %}\
|
|
369
|
-
## [unreleased]
|
|
370
|
-
{% endif %}\
|
|
371
|
-
{% for group, commits in commits | group_by(attribute="group") %}
|
|
372
|
-
### {{ group | striptags | trim | upper_first }}
|
|
373
|
-
{% for commit in commits %}
|
|
374
|
-
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
|
|
375
|
-
{% if commit.breaking %}[**breaking**] {% endif %}\
|
|
376
|
-
{{ commit.message | upper_first }}\
|
|
377
|
-
{% endfor %}
|
|
378
|
-
{% endfor %}
|
|
379
|
-
"""
|
|
380
|
-
trim = true
|
|
381
|
-
render_always = true
|
|
382
|
-
|
|
383
|
-
[git]
|
|
384
|
-
conventional_commits = true
|
|
385
|
-
filter_unconventional = true
|
|
386
|
-
require_conventional = false
|
|
387
|
-
split_commits = false
|
|
388
|
-
protect_breaking_commits = false
|
|
389
|
-
commit_parsers = [
|
|
390
|
-
{ message = "^feat", group = "<!-- 0 -->๐ Features" },
|
|
391
|
-
{ message = "^fix", group = "<!-- 1 -->๐ Bug Fixes" },
|
|
392
|
-
{ message = "^doc", group = "<!-- 3 -->๐ Documentation" },
|
|
393
|
-
{ message = "^perf", group = "<!-- 4 -->โก Performance" },
|
|
394
|
-
{ message = "^refactor", group = "<!-- 2 -->๐ Refactor" },
|
|
395
|
-
{ message = "^style", group = "<!-- 5 -->๐จ Styling" },
|
|
396
|
-
{ message = "^test", group = "<!-- 6 -->๐งช Testing" },
|
|
397
|
-
{ message = "^chore\\(release\\): prepare for", skip = true },
|
|
398
|
-
{ message = "^chore\\(deps.*\\)", skip = true },
|
|
399
|
-
{ message = "^chore\\(pr\\)", skip = true },
|
|
400
|
-
{ message = "^chore\\(pull\\)", skip = true },
|
|
401
|
-
{ message = "^chore|^ci", group = "<!-- 7 -->โ๏ธ Miscellaneous Tasks" },
|
|
402
|
-
{ body = ".*security", group = "<!-- 8 -->๐ก๏ธ Security" },
|
|
403
|
-
{ message = "^revert", group = "<!-- 9 -->โ๏ธ Revert" },
|
|
404
|
-
{ message = ".*", group = "<!-- 10 -->๐ผ Other" },
|
|
405
|
-
]
|
|
406
|
-
filter_commits = false
|
|
407
|
-
link_parsers = []
|
|
408
|
-
use_branch_tags = false
|
|
409
|
-
topo_order = false
|
|
410
|
-
topo_order_commits = true
|
|
411
|
-
sort_commits = "oldest"
|
|
412
|
-
recurse_submodules = false
|
|
413
|
-
```
|
|
414
|
-
|
|
415
|
-
> For more customization options, refer to the [git-cliff > Configuration](https://git-cliff.org/docs/configuration).
|
|
416
|
-
|
|
417
|
-
## License
|
|
418
|
-
|
|
419
|
-
This project is licensed under the [MIT license](LICENSE).
|
|
3
|
+
Currently, the `master` branch is under heavy development for an upcoming major release and may be unstable or missing features.
|