fireflyy 4.0.0-dev.df58d2b → 4.0.0-dev.fc28987

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.
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "description": "Firefly CLI configuration.",
3
4
  "type": "object",
4
5
  "properties": {
5
6
  "cwd": {
@@ -30,9 +31,12 @@
30
31
  "description": "Org/user scope without '@'. Auto-detected from package.json.",
31
32
  "type": "string"
32
33
  },
34
+ "repository": {
35
+ "description": "GitHub repository in 'owner/repo' format.",
36
+ "type": "string"
37
+ },
33
38
  "base": {
34
39
  "description": "Relative path from repository root to project root.",
35
- "default": "",
36
40
  "type": "string"
37
41
  },
38
42
  "branch": {
@@ -94,7 +98,6 @@
94
98
  },
95
99
  "releaseNotes": {
96
100
  "description": "Custom release notes for changelog.",
97
- "default": "",
98
101
  "type": "string"
99
102
  },
100
103
  "commitMessage": {
@@ -144,17 +147,14 @@
144
147
  },
145
148
  "releaseLatest": {
146
149
  "description": "Mark as latest release.",
147
- "default": true,
148
150
  "type": "boolean"
149
151
  },
150
152
  "releasePreRelease": {
151
153
  "description": "Mark as pre-release.",
152
- "default": false,
153
154
  "type": "boolean"
154
155
  },
155
156
  "releaseDraft": {
156
157
  "description": "Release as draft version.",
157
- "default": false,
158
158
  "type": "boolean"
159
159
  }
160
160
  }
@@ -1,6 +1,6 @@
1
- import { t as logger } from "./main.js";
2
- import { g as invalidError, i as FireflyOkAsync, r as FireflyOk, t as FireflyErr } from "./result.constructors-D9jmQ0uj.js";
3
- import { n as TRANSITION_KEYWORDS } from "./version-strategy.service-vh5KeNCA.js";
1
+ import { g as invalidError, i as FireflyOkAsync, r as FireflyOk, t as FireflyErr } from "./result.constructors-DoAoYdfF.js";
2
+ import { t as logger } from "./logging-Bpk2RzGc.js";
3
+ import { TRANSITION_KEYWORDS } from "./version-strategy.service-Dln42gxC.js";
4
4
 
5
5
  //#region src/domain/commits/commit-types.ts
6
6
  /**
@@ -0,0 +1,130 @@
1
+ import z from "zod";
2
+
3
+ //#region src/commands/release/release.config.d.ts
4
+
5
+ declare const ReleaseConfigSchema: z.ZodObject<{
6
+ name: z.ZodOptional<z.ZodString>;
7
+ scope: z.ZodOptional<z.ZodString>;
8
+ repository: z.ZodOptional<z.ZodString>;
9
+ base: z.ZodOptional<z.ZodString>;
10
+ branch: z.ZodOptional<z.ZodString>;
11
+ changelogPath: z.ZodDefault<z.ZodString>;
12
+ bumpStrategy: z.ZodDefault<z.ZodUnion<[z.ZodEnum<{
13
+ auto: "auto";
14
+ manual: "manual";
15
+ }>, z.ZodLiteral<"">]>>;
16
+ releaseType: z.ZodOptional<z.ZodEnum<{
17
+ major: "major";
18
+ minor: "minor";
19
+ patch: "patch";
20
+ prerelease: "prerelease";
21
+ premajor: "premajor";
22
+ preminor: "preminor";
23
+ prepatch: "prepatch";
24
+ graduate: "graduate";
25
+ }>>;
26
+ preReleaseId: z.ZodOptional<z.ZodString>;
27
+ preReleaseBase: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"0">, z.ZodLiteral<"1">]>>;
28
+ releaseNotes: z.ZodOptional<z.ZodString>;
29
+ commitMessage: z.ZodDefault<z.ZodString>;
30
+ tagName: z.ZodDefault<z.ZodString>;
31
+ skipBump: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
32
+ skipChangelog: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
33
+ skipPush: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
34
+ skipGitHubRelease: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
35
+ skipGit: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
36
+ skipPreflightCheck: z.ZodDefault<z.ZodCoercedBoolean<unknown>>;
37
+ releaseTitle: z.ZodDefault<z.ZodString>;
38
+ releaseLatest: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
39
+ releasePreRelease: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
40
+ releaseDraft: z.ZodOptional<z.ZodCoercedBoolean<unknown>>;
41
+ }, z.core.$strip>;
42
+ type BaseRelease = z.infer<typeof ReleaseConfigSchema>;
43
+ type ReleaseFlagKeys = "releaseLatest" | "releasePreRelease" | "releaseDraft";
44
+ type ExclusiveReleaseFlags = {
45
+ releaseLatest: true;
46
+ releasePreRelease?: false | undefined;
47
+ releaseDraft?: false | undefined;
48
+ } | {
49
+ releasePreRelease: true;
50
+ releaseLatest?: false | undefined;
51
+ releaseDraft?: false | undefined;
52
+ } | {
53
+ releaseDraft: true;
54
+ releaseLatest?: false | undefined;
55
+ releasePreRelease?: false | undefined;
56
+ } | {
57
+ releaseLatest?: false | undefined;
58
+ releasePreRelease?: false | undefined;
59
+ releaseDraft?: false | undefined;
60
+ };
61
+ type ReleaseConfig = Omit<BaseRelease, ReleaseFlagKeys> & ExclusiveReleaseFlags;
62
+ //#endregion
63
+ //#region src/cli/config/config.schema.d.ts
64
+ /**
65
+ * Complete Firefly configuration schema.
66
+ * Combines global options with command-specific configuration sections.
67
+ */
68
+ declare const FireflyConfigSchema: z.ZodObject<{
69
+ release: z.ZodOptional<z.ZodObject<{
70
+ name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
71
+ scope: z.ZodOptional<z.ZodOptional<z.ZodString>>;
72
+ repository: z.ZodOptional<z.ZodOptional<z.ZodString>>;
73
+ base: z.ZodOptional<z.ZodOptional<z.ZodString>>;
74
+ branch: z.ZodOptional<z.ZodOptional<z.ZodString>>;
75
+ changelogPath: z.ZodOptional<z.ZodDefault<z.ZodString>>;
76
+ bumpStrategy: z.ZodOptional<z.ZodDefault<z.ZodUnion<[z.ZodEnum<{
77
+ auto: "auto";
78
+ manual: "manual";
79
+ }>, z.ZodLiteral<"">]>>>;
80
+ releaseType: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
81
+ major: "major";
82
+ minor: "minor";
83
+ patch: "patch";
84
+ prerelease: "prerelease";
85
+ premajor: "premajor";
86
+ preminor: "preminor";
87
+ prepatch: "prepatch";
88
+ graduate: "graduate";
89
+ }>>>;
90
+ preReleaseId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
91
+ preReleaseBase: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodLiteral<"0">, z.ZodLiteral<"1">]>>>;
92
+ releaseNotes: z.ZodOptional<z.ZodOptional<z.ZodString>>;
93
+ commitMessage: z.ZodOptional<z.ZodDefault<z.ZodString>>;
94
+ tagName: z.ZodOptional<z.ZodDefault<z.ZodString>>;
95
+ skipBump: z.ZodOptional<z.ZodDefault<z.ZodCoercedBoolean<unknown>>>;
96
+ skipChangelog: z.ZodOptional<z.ZodDefault<z.ZodCoercedBoolean<unknown>>>;
97
+ skipPush: z.ZodOptional<z.ZodDefault<z.ZodCoercedBoolean<unknown>>>;
98
+ skipGitHubRelease: z.ZodOptional<z.ZodDefault<z.ZodCoercedBoolean<unknown>>>;
99
+ skipGit: z.ZodOptional<z.ZodDefault<z.ZodCoercedBoolean<unknown>>>;
100
+ skipPreflightCheck: z.ZodOptional<z.ZodDefault<z.ZodCoercedBoolean<unknown>>>;
101
+ releaseTitle: z.ZodOptional<z.ZodDefault<z.ZodString>>;
102
+ releaseLatest: z.ZodOptional<z.ZodOptional<z.ZodCoercedBoolean<unknown>>>;
103
+ releasePreRelease: z.ZodOptional<z.ZodOptional<z.ZodCoercedBoolean<unknown>>>;
104
+ releaseDraft: z.ZodOptional<z.ZodOptional<z.ZodCoercedBoolean<unknown>>>;
105
+ }, z.core.$strip>>;
106
+ cwd: z.ZodOptional<z.ZodOptional<z.ZodString>>;
107
+ dryRun: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
108
+ verbose: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
109
+ enableRollback: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
110
+ }, z.core.$strip>;
111
+ /**
112
+ * TypeScript type for Firefly configuration.
113
+ * Use this type when you need to reference the configuration shape without runtime validation.
114
+ */
115
+ type FireflyConfig = z.infer<typeof FireflyConfigSchema> & {
116
+ release?: Partial<Omit<ReleaseConfig, ReleaseFlagKeys>> & ExclusiveReleaseFlags;
117
+ };
118
+ //#endregion
119
+ //#region src/config/index.d.ts
120
+ /**
121
+ * Helper function to define a type-safe Firefly configuration.
122
+ *
123
+ * Provides IntelliSense autocompletion and type checking for config files.
124
+ *
125
+ * @param options - The configuration options
126
+ * @returns The same options (identity function for type inference)
127
+ */
128
+ declare function defineConfig<T extends FireflyConfig>(options: T): T;
129
+ //#endregion
130
+ export { defineConfig };
@@ -6,17 +6,6 @@
6
6
  *
7
7
  * @param options - The configuration options
8
8
  * @returns The same options (identity function for type inference)
9
- *
10
- * @example
11
- * ```ts
12
- * export default defineConfig({
13
- * verbose: true,
14
- * release: {
15
- * bumpStrategy: "conventional",
16
- * releaseType: "github",
17
- * },
18
- * });
19
- * ```
20
9
  */
21
10
  function defineConfig(options) {
22
11
  return options;
@@ -0,0 +1,74 @@
1
+ //#region src/core/environment/debug-flags.ts
2
+ /**
3
+ * Debug flags are environment variables prefixed with `FIREFLY_DEBUG_` that
4
+ * enable diagnostic features during development and troubleshooting.
5
+ *
6
+ * @example
7
+ * ```typescript
8
+ * if (DebugFlags.showRawError) {
9
+ * logger.error(parseResult.error);
10
+ * }
11
+ * ```
12
+ */
13
+ var DebugFlags = class {
14
+ constructor() {}
15
+ /**
16
+ * When enabled, displays raw Zod validation errors for configuration parsing.
17
+ *
18
+ * Useful for debugging configuration schema issues and understanding
19
+ * why validation failed at a granular level.
20
+ */
21
+ static get showRawError() {
22
+ return Boolean(process.env.FIREFLY_DEBUG_SHOW_RAW_ERROR);
23
+ }
24
+ /**
25
+ * When enabled, logs the loaded configuration file contents.
26
+ *
27
+ * Useful for debugging configuration loading and understanding
28
+ * what values are being read from config files.
29
+ */
30
+ static get showFileConfig() {
31
+ return Boolean(process.env.FIREFLY_DEBUG_SHOW_FILE_CONFIG);
32
+ }
33
+ /**
34
+ * When enabled, displays task graph statistics during release execution.
35
+ *
36
+ * Shows information about task dependencies, execution order,
37
+ * and graph structure for debugging workflow issues.
38
+ */
39
+ static get showTaskGraphStats() {
40
+ return Boolean(process.env.FIREFLY_DEBUG_SHOW_TASK_GRAPH_STATS);
41
+ }
42
+ /**
43
+ * When enabled, prevents truncation of release notes in GitHub CLI logs.
44
+ *
45
+ * By default, release notes are truncated in logs to avoid pollution.
46
+ * Enable this flag to see full release notes content during debugging.
47
+ */
48
+ static get dontTruncateReleaseNotes() {
49
+ return Boolean(process.env.FIREFLY_DEBUG_DONT_TRUNCATE_RELEASE_NOTES?.trim());
50
+ }
51
+ /**
52
+ * When enabled, prevents redaction of sensitive GitHub CLI arguments in logs.
53
+ *
54
+ * By default, sensitive values (tokens, passwords, etc.) are redacted.
55
+ * Enable this flag to see full argument values during debugging.
56
+ *
57
+ * WARNING: Use with caution as this may expose sensitive information.
58
+ */
59
+ static get dontRedactGithubCliArgs() {
60
+ return Boolean(process.env.FIREFLY_DEBUG_DONT_REDACT_GITHUB_CLI_ARGS?.trim());
61
+ }
62
+ /**
63
+ * When enabled, logs verbose details for git commit operations.
64
+ *
65
+ * By default, the verbose log of the git show command is disabled to reduce noise, if commits are many.
66
+ * Enable this flag to see detailed commit information during debugging.
67
+ */
68
+ static get showVerboseGitCommitDetails() {
69
+ return Boolean(process.env.FIREFLY_DEBUG_SHOW_VERBOSE_GIT_COMMIT_DETAILS?.trim());
70
+ }
71
+ };
72
+
73
+ //#endregion
74
+ export { DebugFlags as t };
@@ -1,5 +1,5 @@
1
- import { t as logger } from "./main.js";
2
- import { i as FireflyOkAsync } from "./result.constructors-D9jmQ0uj.js";
1
+ import { i as FireflyOkAsync } from "./result.constructors-DoAoYdfF.js";
2
+ import { t as logger } from "./logging-Bpk2RzGc.js";
3
3
 
4
4
  //#region src/infrastructure/dry-run/index.ts
5
5
  /**
@@ -1,7 +1,7 @@
1
- import { t as logger } from "./main.js";
2
- import { l as notFoundErrAsync } from "./result.constructors-D9jmQ0uj.js";
3
- import { n as wrapPromise } from "./result.utilities-CdBL5noX.js";
4
- import { t as withDryRun } from "./dry-run-korHDlWr.js";
1
+ import { l as notFoundErrAsync } from "./result.constructors-DoAoYdfF.js";
2
+ import { n as wrapPromise } from "./result.utilities-DXSJU70_.js";
3
+ import { t as logger } from "./logging-Bpk2RzGc.js";
4
+ import { t as withDryRun } from "./dry-run-C7RaPEq8.js";
5
5
 
6
6
  //#region src/services/implementations/filesystem.service.ts
7
7
  /**
@@ -1,6 +1,7 @@
1
- import { t as logger } from "./main.js";
2
- import { h as failedError, i as FireflyOkAsync, o as failedErrAsync } from "./result.constructors-D9jmQ0uj.js";
3
- import { t as withDryRun } from "./dry-run-korHDlWr.js";
1
+ import { t as DebugFlags } from "./debug-flags-K3yK5B6O.js";
2
+ import { h as failedError, i as FireflyOkAsync, o as failedErrAsync } from "./result.constructors-DoAoYdfF.js";
3
+ import { t as logger } from "./logging-Bpk2RzGc.js";
4
+ import { t as withDryRun } from "./dry-run-C7RaPEq8.js";
4
5
  import { ResultAsync } from "neverthrow";
5
6
  import { z } from "zod";
6
7
 
@@ -397,7 +398,7 @@ var DefaultGitService = class {
397
398
  "--no-patch",
398
399
  `--format=${format}`,
399
400
  hash
400
- ]);
401
+ ], { verbose: DebugFlags.showVerboseGitCommitDetails });
401
402
  }
402
403
  getUnpushedCommits() {
403
404
  return this.getCurrentBranch().andThen((branch) => {
@@ -0,0 +1,20 @@
1
+ import { createConsola } from "consola";
2
+ import { colors } from "consola/utils";
3
+
4
+ //#region src/infrastructure/logging/index.ts
5
+ const opts = {
6
+ date: false,
7
+ compact: true,
8
+ columns: 0
9
+ };
10
+ const _logger = createConsola({ formatOptions: opts });
11
+ const logger = createConsola({
12
+ formatOptions: opts,
13
+ reporters: [{ log(logObj) {
14
+ if (logObj.type === "verbose") console.log(colors.gray(logObj.args.join(" ")));
15
+ else _logger.log(logObj);
16
+ } }]
17
+ });
18
+
19
+ //#endregion
20
+ export { logger as t };
package/dist/main.js CHANGED
@@ -1,7 +1,4 @@
1
1
  #!/usr/bin/env bun
2
- import { createConsola } from "consola";
3
- import { colors } from "consola/utils";
4
-
5
2
  //#region src/core/environment/runtime-env.ts
6
3
  /**
7
4
  * These are set during CLI initialization in main.ts and provide
@@ -53,25 +50,9 @@ var RuntimeEnv = class {
53
50
  }
54
51
  };
55
52
 
56
- //#endregion
57
- //#region src/infrastructure/logging/index.ts
58
- const opts = {
59
- date: false,
60
- compact: true,
61
- columns: 0
62
- };
63
- const _logger = createConsola({ formatOptions: opts });
64
- const logger = createConsola({
65
- formatOptions: opts,
66
- reporters: [{ log(logObj) {
67
- if (logObj.type === "verbose") console.log(colors.gray(logObj.args.join(" ")));
68
- else _logger.log(logObj);
69
- } }]
70
- });
71
-
72
53
  //#endregion
73
54
  //#region package.json
74
- var version = "4.0.0-dev.df58d2b";
55
+ var version = "4.0.0-dev.fc28987";
75
56
  var description = " CLI orchestrator for automatic semantic versioning, changelog generation, and creating releases. Built for my own use cases.";
76
57
  var dependencies = {
77
58
  "c12": "^3.3.2",
@@ -99,13 +80,10 @@ async function main() {
99
80
  description,
100
81
  gitCliffVersion: dependencies["git-cliff"]?.replace("^", "") || "unknown"
101
82
  });
102
- const { createFireflyCLI } = await import("./program-CW3hIbzh.js");
103
- createFireflyCLI().parseAsync(process.argv).catch((error) => {
104
- logger.error("Fatal error:", error);
105
- process.exit(1);
106
- });
83
+ const { createFireflyCLI } = await import("./program-d3d_c7Hx.js");
84
+ createFireflyCLI().parseAsync(process.argv).catch(() => process.exit(1));
107
85
  }
108
86
  main();
109
87
 
110
88
  //#endregion
111
- export { RuntimeEnv as n, logger as t };
89
+ export { RuntimeEnv as t };
@@ -1,6 +1,6 @@
1
- import { t as logger } from "./main.js";
2
- import { d as validationErr, f as validationErrAsync, i as FireflyOkAsync, v as toFireflyError } from "./result.constructors-D9jmQ0uj.js";
3
- import { n as parseSchema } from "./schema.utilities-BOJqWEey.js";
1
+ import { d as validationErr, f as validationErrAsync, i as FireflyOkAsync, v as toFireflyError } from "./result.constructors-DoAoYdfF.js";
2
+ import { t as logger } from "./logging-Bpk2RzGc.js";
3
+ import { n as parseSchema } from "./schema.utilities-C1yimTtB.js";
4
4
  import { Result } from "neverthrow";
5
5
  import z$1 from "zod";
6
6