fireflyy 4.0.0-dev.4721ae4 → 4.0.0-dev.5da9e52

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,6 +1,6 @@
1
1
  import { t as logger } from "./main.js";
2
- import { i as FireflyOkAsync, m as failedError, o as failedErrAsync } from "./result.constructors-C9M1MP3_.js";
3
- import { t as withDryRun } from "./dry-run-BfYCtldz.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-BeuzUufT.js";
4
4
  import { ResultAsync } from "neverthrow";
5
5
  import { z } from "zod";
6
6
 
@@ -257,7 +257,7 @@ var DefaultGitService = class {
257
257
  return this.git(["rev-parse", "--is-inside-work-tree"]).map(() => true).orElse(() => FireflyOkAsync(false));
258
258
  }
259
259
  getRepositoryRoot() {
260
- return this.git(["rev-parse", "--show-toplevel"]).map((output) => output.trim());
260
+ return this.git(["rev-parse", "--show-toplevel"]).andTee(() => logger.verbose("DefaultGitService: Resolving repository root")).map((output) => output.trim()).andTee(() => logger.verbose("DefaultGitService: Repository root resolved"));
261
261
  }
262
262
  getRemoteUrl(remote) {
263
263
  const remoteName = remote ?? "origin";
@@ -280,12 +280,14 @@ var DefaultGitService = class {
280
280
  else if (index !== " " && index !== "?") hasStaged = true;
281
281
  if (workTree !== " " && workTree !== "?") hasUnstaged = true;
282
282
  }
283
- return {
283
+ const status = {
284
284
  hasStaged,
285
285
  hasUnstaged,
286
286
  hasUntracked,
287
287
  isClean: lines.length === 0
288
288
  };
289
+ logger.verbose(`DefaultGitService: Git status: staged=${status.hasStaged},unstaged=${status.hasUnstaged},untracked=${status.hasUntracked},clean=${status.isClean}`);
290
+ return status;
289
291
  });
290
292
  }
291
293
  isWorkingTreeClean() {
@@ -312,7 +314,7 @@ var DefaultGitService = class {
312
314
  const includeStaged = filter?.staged ?? true;
313
315
  const includeUnstaged = filter?.unstaged ?? true;
314
316
  return this.git(["status", "--porcelain"]).map((output) => {
315
- return this.parseStatusOutput(output).filter((file) => {
317
+ const filtered = this.parseStatusOutput(output).filter((file) => {
316
318
  const isStaged = file.indexStatus !== " " && file.indexStatus !== "?";
317
319
  const isUnstaged = file.workTreeStatus !== " " && file.workTreeStatus !== "?";
318
320
  if (includeStaged && includeUnstaged) return isStaged || isUnstaged;
@@ -320,6 +322,8 @@ var DefaultGitService = class {
320
322
  if (includeUnstaged) return isUnstaged;
321
323
  return false;
322
324
  });
325
+ logger.verbose(`DefaultGitService: Found ${filtered.length} file(s) for filter staged=${includeStaged} unstaged=${includeUnstaged}`);
326
+ return filtered;
323
327
  });
324
328
  }
325
329
  getFileNames(filter) {
@@ -344,11 +348,13 @@ var DefaultGitService = class {
344
348
  const isRemote = line.includes("remotes/");
345
349
  let branchName = line.replace(CURRENT_BRANCH_MARKER_REGEX, "").trim();
346
350
  if (isRemote) branchName = branchName.replace(REMOTES_PREFIX_REGEX, "");
347
- return {
351
+ const branch = {
348
352
  name: branchName,
349
353
  isCurrent,
350
354
  isRemote
351
355
  };
356
+ logger.verbose(`DefaultGitService: Parsed branch: ${branch.name} current=${branch.isCurrent} remote=${branch.isRemote}`);
357
+ return branch;
352
358
  }
353
359
  listBranches(includeRemote) {
354
360
  const args = ["branch"];
@@ -359,7 +365,7 @@ var DefaultGitService = class {
359
365
  }
360
366
  createCommit(message, options) {
361
367
  if (options?.dryRun) {
362
- logger.verbose("GitService: Dry run, skipping commit");
368
+ logger.verbose("DefaultGitService: Dry run, skipping commit");
363
369
  return FireflyOkAsync({ sha: "dry-run-sha" });
364
370
  }
365
371
  const args = [
@@ -402,6 +408,7 @@ var DefaultGitService = class {
402
408
  `${upstream}..HEAD`
403
409
  ]).map((output) => {
404
410
  const count = Number.parseInt(output.trim(), 10) || 0;
411
+ logger.verbose(`DefaultGitService: Unpushed commits count for ${upstream}: ${count}`);
405
412
  return {
406
413
  hasUnpushed: count > 0,
407
414
  count
@@ -413,6 +420,7 @@ var DefaultGitService = class {
413
420
  "HEAD"
414
421
  ]).map((output) => {
415
422
  const count = Number.parseInt(output.trim(), 10) || 0;
423
+ logger.verbose(`DefaultGitService: Total commit count: ${count}`);
416
424
  return {
417
425
  hasUnpushed: count > 0,
418
426
  count
@@ -426,7 +434,7 @@ var DefaultGitService = class {
426
434
  }
427
435
  createTag(name, options) {
428
436
  if (options?.dryRun) {
429
- logger.verbose(`GitService: Dry run, skipping tag creation: ${name}`);
437
+ logger.verbose(`DefaultGitService: Dry run, skipping tag creation: ${name}`);
430
438
  return FireflyOkAsync(void 0);
431
439
  }
432
440
  const args = ["tag"];
@@ -439,7 +447,7 @@ var DefaultGitService = class {
439
447
  const scope = options?.scope ?? "local";
440
448
  const remote = options?.remote ?? "origin";
441
449
  if (options?.dryRun) {
442
- logger.verbose(`GitService: Dry run, skipping tag deletion (${scope}): ${name}`);
450
+ logger.verbose(`DefaultGitService: Dry run, skipping tag deletion (${scope}): ${name}`);
443
451
  return FireflyOkAsync(void 0);
444
452
  }
445
453
  if (scope === "local") return this.git([
@@ -447,11 +455,15 @@ var DefaultGitService = class {
447
455
  "-d",
448
456
  name
449
457
  ]).map(() => void 0);
450
- if (scope === "remote") return this.git([
451
- "push",
452
- remote,
453
- `:refs/tags/${name}`
454
- ]).map(() => void 0);
458
+ if (scope === "remote") {
459
+ logger.verbose(`DefaultGitService: Deleting remote tag: ${name} on ${remote}`);
460
+ return this.git([
461
+ "push",
462
+ remote,
463
+ `:refs/tags/${name}`
464
+ ]).andTee(() => logger.verbose(`DefaultGitService: Remote tag deleted: ${name} on ${remote}`)).map(() => void 0);
465
+ }
466
+ logger.verbose(`DefaultGitService: Deleting tag locally and remotely: ${name} on ${remote}`);
455
467
  return this.git([
456
468
  "tag",
457
469
  "-d",
@@ -460,17 +472,21 @@ var DefaultGitService = class {
460
472
  "push",
461
473
  remote,
462
474
  `:refs/tags/${name}`
463
- ])).map(() => void 0);
475
+ ])).andTee(() => logger.verbose(`DefaultGitService: Local and remote tag deleted: ${name} on ${remote}`)).map(() => void 0);
464
476
  }
465
477
  hasTag(name) {
466
478
  return this.git([
467
479
  "tag",
468
480
  "--list",
469
481
  name
470
- ]).map((output) => output.trim() === name);
482
+ ]).map((output) => {
483
+ const exists = output.trim() === name;
484
+ logger.verbose(`DefaultGitService: Tag ${name} exists=${exists}`);
485
+ return exists;
486
+ });
471
487
  }
472
488
  hasAnyTags() {
473
- return this.getLatestTag().map((tag) => tag !== null);
489
+ return this.getLatestTag().andTee(() => logger.verbose("DefaultGitService: Checking if any tags exist")).map((tag) => tag !== null);
474
490
  }
475
491
  listTags() {
476
492
  return this.git(["tag", "--list"]).map((output) => output.split("\n").map((tag) => tag.trim()).filter((tag) => tag.length > 0));
@@ -494,25 +510,28 @@ var DefaultGitService = class {
494
510
  "--format=%(contents)",
495
511
  name
496
512
  ]).map((output) => {
497
- return output.trim() || null;
513
+ const message = output.trim();
514
+ logger.verbose(`DefaultGitService: Tag message for ${name}: ${message?.substring(0, 60) ?? "(none)"}`);
515
+ return message || null;
498
516
  }).orElse(() => FireflyOkAsync(null));
499
517
  }
500
518
  stage(paths) {
501
519
  const pathArray = Array.isArray(paths) ? paths : [paths];
502
- return this.git(["add", ...pathArray]).map(() => void 0);
520
+ return this.git(["add", ...pathArray]).andTee(() => logger.verbose(`DefaultGitService: Staged paths: ${pathArray.join(", ")}`)).map(() => void 0);
503
521
  }
504
522
  unstage(paths) {
505
523
  const pathArray = Array.isArray(paths) ? paths : [paths];
524
+ logger.verbose(`DefaultGitService: Unstaging paths: ${pathArray.join(", ")}`);
506
525
  return this.git([
507
526
  "reset",
508
527
  "HEAD",
509
528
  "--",
510
529
  ...pathArray
511
- ]).map(() => void 0);
530
+ ]).andTee(() => logger.verbose(`DefaultGitService: Unstaged paths: ${pathArray.join(", ")}`)).map(() => void 0);
512
531
  }
513
532
  push(options) {
514
533
  if (options?.dryRun) {
515
- logger.verbose("GitService: Dry run, skipping push");
534
+ logger.verbose("DefaultGitService: Dry run, skipping push");
516
535
  return FireflyOkAsync(void 0);
517
536
  }
518
537
  const args = ["push"];
@@ -550,9 +569,10 @@ var DefaultGitService = class {
550
569
  inferRepositoryUrl() {
551
570
  return this.getUpstreamRemote().andThen((upstreamRemote) => {
552
571
  if (upstreamRemote) {
553
- logger.verbose(`GitService: Inferring repository URL from upstream remote: ${upstreamRemote}`);
572
+ logger.verbose(`DefaultGitService: Inferring repository URL from upstream remote: ${upstreamRemote}`);
554
573
  return this.getRemoteUrl(upstreamRemote).map((url) => url).orElse(() => this.tryOriginOrFirstRemote());
555
574
  }
575
+ logger.verbose("DefaultGitService: No upstream remote; falling back to origin or first remote");
556
576
  return this.tryOriginOrFirstRemote();
557
577
  });
558
578
  }
@@ -561,16 +581,16 @@ var DefaultGitService = class {
561
581
  */
562
582
  tryOriginOrFirstRemote() {
563
583
  return this.getRemoteUrl("origin").map((url) => {
564
- logger.verbose("GitService: Inferring repository URL from origin remote");
584
+ logger.verbose("DefaultGitService: Inferring repository URL from origin remote");
565
585
  return url;
566
586
  }).orElse(() => {
567
587
  return this.listRemotes().andThen((remotes) => {
568
588
  if (remotes.length === 0) {
569
- logger.verbose("GitService: No remotes configured, cannot infer repository URL");
589
+ logger.verbose("DefaultGitService: No remotes configured, cannot infer repository URL");
570
590
  return FireflyOkAsync(null);
571
591
  }
572
592
  const firstRemote = remotes[0];
573
- logger.verbose(`GitService: Inferring repository URL from first remote: ${firstRemote}`);
593
+ logger.verbose(`DefaultGitService: Inferring repository URL from first remote: ${firstRemote}`);
574
594
  return this.getRemoteUrl(firstRemote).map((url) => url).orElse(() => FireflyOkAsync(null));
575
595
  });
576
596
  });
package/dist/main.js CHANGED
@@ -71,7 +71,7 @@ const logger = createConsola({
71
71
 
72
72
  //#endregion
73
73
  //#region package.json
74
- var version = "4.0.0-dev.4721ae4";
74
+ var version = "4.0.0-dev.5da9e52";
75
75
  var description = " CLI orchestrator for automatic semantic versioning, changelog generation, and creating releases. Built for my own use cases.";
76
76
  var dependencies = {
77
77
  "c12": "^3.3.2",
@@ -99,7 +99,7 @@ async function main() {
99
99
  description,
100
100
  gitCliffVersion: dependencies["git-cliff"]?.replace("^", "") || "unknown"
101
101
  });
102
- const { createFireflyCLI } = await import("./program-Cw3A_k7R.js");
102
+ const { createFireflyCLI } = await import("./program-5IEws7yO.js");
103
103
  createFireflyCLI().parseAsync(process.argv).catch((error) => {
104
104
  logger.error("Fatal error:", error);
105
105
  process.exit(1);
@@ -1,5 +1,6 @@
1
- import { d as validationErrAsync, g as toFireflyError, i as FireflyOkAsync, u as validationErr } from "./result.constructors-C9M1MP3_.js";
2
- import { n as parseSchema } from "./schema.utilities-BGd9t1wm.js";
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";
3
4
  import { Result } from "neverthrow";
4
5
  import z$1 from "zod";
5
6
 
@@ -28,7 +29,7 @@ var DefaultPackageJsonService = class DefaultPackageJsonService {
28
29
  return this.fs.read(path).map((content) => this.replaceVersionInContent(content, newVersion)).andThen((updatedContent) => this.fs.write(path, updatedContent)).andThen(() => this.read(path).andThen((pkg) => {
29
30
  if (pkg.version !== newVersion) return validationErrAsync({ message: `Failed to verify updated version in package.json at path: ${path}` });
30
31
  return FireflyOkAsync(void 0);
31
- }));
32
+ })).andTee(() => logger.verbose(`DefaultPackageJsonService: Updated version in package.json at path: ${path} to ${newVersion}`));
32
33
  }
33
34
  /**
34
35
  * Replaces the version string in the package.json content.
@@ -1,7 +1,7 @@
1
1
  import { n as RuntimeEnv, t as logger } from "./main.js";
2
- import { _ as validationError, a as conflictErrAsync, c as notFoundErrAsync, d as validationErrAsync, f as conflictError, h as notFoundError, i as FireflyOkAsync, l as timeoutErrAsync, m as failedError, n as FireflyErrAsync, r as FireflyOk, s as invalidErr, t as FireflyErr, u as validationErr, v as wrapErrorMessage } from "./result.constructors-C9M1MP3_.js";
3
- import { n as wrapPromise, r as zip3Async, t as ensureNotAsync } from "./result.utilities-DC5shlhT.js";
4
- import { n as parseSchema, t as formatZodErrors } from "./schema.utilities-BGd9t1wm.js";
2
+ import { _ as notFoundError, a as conflictErrAsync, b as wrapErrorMessage, c as invalidErrAsync, d as validationErr, f as validationErrAsync, h as failedError, i as FireflyOkAsync, l as notFoundErrAsync, n as FireflyErrAsync, p as conflictError, r as FireflyOk, s as invalidErr, t as FireflyErr, u as timeoutErrAsync, y as validationError } from "./result.constructors-D9jmQ0uj.js";
3
+ import { n as wrapPromise, r as zip3Async, t as ensureNotAsync } from "./result.utilities-CdBL5noX.js";
4
+ import { n as parseSchema, t as formatZodErrors } from "./schema.utilities-BOJqWEey.js";
5
5
  import { LogLevels } from "consola";
6
6
  import { colors } from "consola/utils";
7
7
  import { Command } from "commander";
@@ -1003,9 +1003,10 @@ function createBumpExecutionGroup() {
1003
1003
  */
1004
1004
  function shouldSkipBumpStrategy(ctx) {
1005
1005
  const { skipBump, releaseType, bumpStrategy } = ctx.config;
1006
+ const { selectedReleaseType, selectedBumpStrategy } = ctx.data;
1006
1007
  if (skipBump) return true;
1007
- if (releaseType) return true;
1008
- if (!bumpStrategy) return true;
1008
+ if (releaseType || selectedReleaseType) return true;
1009
+ if (!Boolean(bumpStrategy || selectedBumpStrategy)) return true;
1009
1010
  return false;
1010
1011
  }
1011
1012
  /**
@@ -1013,9 +1014,11 @@ function shouldSkipBumpStrategy(ctx) {
1013
1014
  */
1014
1015
  function getSkipReason(ctx) {
1015
1016
  const { skipBump, releaseType, bumpStrategy } = ctx.config;
1017
+ const { selectedReleaseType, selectedBumpStrategy } = ctx.data;
1016
1018
  if (skipBump) return "skipBump is enabled";
1017
- if (releaseType) return `releaseType already set to '${releaseType}'`;
1018
- if (!bumpStrategy) return "no bumpStrategy configured";
1019
+ if (releaseType) return `releaseType already set to '${releaseType}' (config)`;
1020
+ if (selectedReleaseType) return `releaseType already set to '${selectedReleaseType}' (data)`;
1021
+ if (!Boolean(bumpStrategy || selectedBumpStrategy)) return "no bumpStrategy configured";
1019
1022
  return "unknown reason";
1020
1023
  }
1021
1024
  function createDelegateBumpStrategyTask() {
@@ -1034,7 +1037,10 @@ function createDelegateBumpStrategyTask() {
1034
1037
  //#endregion
1035
1038
  //#region src/commands/release/tasks/determine-automatic-bump.task.ts
1036
1039
  function createDetermineAutomaticBump() {
1037
- return TaskBuilder.create("determine-automatic-bump").description("Automatically determines the version bump from commit messages").dependsOn("delegate-bump-strategy").skipWhenWithReason((ctx) => ctx.config.skipBump || ctx.config.bumpStrategy !== BUMP_STRATEGY_AUTO, "Skipped: skipBump enabled or bumpStrategy is not 'auto'").execute((ctx) => {
1040
+ return TaskBuilder.create("determine-automatic-bump").description("Automatically determines the version bump from commit messages").dependsOn("delegate-bump-strategy").skipWhenWithReason((ctx) => {
1041
+ const bumpStrategy = ctx.data.selectedBumpStrategy ?? ctx.config.bumpStrategy;
1042
+ return ctx.config.skipBump || bumpStrategy !== BUMP_STRATEGY_AUTO;
1043
+ }, "Skipped: skipBump enabled or bumpStrategy is not 'auto'").execute((ctx) => {
1038
1044
  logger.info("determine-automatic-bump");
1039
1045
  return FireflyOkAsync(ctx);
1040
1046
  }).build();
@@ -1042,17 +1048,61 @@ function createDetermineAutomaticBump() {
1042
1048
 
1043
1049
  //#endregion
1044
1050
  //#region src/commands/release/tasks/prompt-bump-strategy.task.ts
1051
+ const BUMP_STRATEGIES = [{
1052
+ label: "Automatic Bump",
1053
+ value: BUMP_STRATEGY_AUTO,
1054
+ hint: "Determines the next version based on conventional commits history"
1055
+ }, {
1056
+ label: "Manual Bump",
1057
+ value: BUMP_STRATEGY_MANUAL,
1058
+ hint: "Manually specify the next version"
1059
+ }];
1060
+ const VALID_STRATEGY_VALUES = BUMP_STRATEGIES.map((s) => s.value);
1061
+ /**
1062
+ * Validates that the selected strategy is one of the allowed values.
1063
+ *
1064
+ * @param strategy The selected version bump strategy.
1065
+ * @returns A FireflyResult indicating success or failure of validation.
1066
+ */
1067
+ function validateStrategy(strategy) {
1068
+ if (!VALID_STRATEGY_VALUES.includes(strategy)) return invalidErr({ message: `Invalid version bump strategy: ${strategy}` });
1069
+ return FireflyOk(strategy);
1070
+ }
1071
+ /**
1072
+ * Prompts the user to select a bump strategy using the logger's prompt API.
1073
+ */
1074
+ function promptBumpStrategy() {
1075
+ const defaultStrategy = BUMP_STRATEGIES[0];
1076
+ if (!defaultStrategy) return notFoundErrAsync({ message: "No default version bump strategy found" });
1077
+ logger.verbose("PromptBumpStrategyTask: Prompting user for version bump strategy.");
1078
+ const prompt = logger.prompt("Select version bump strategy", {
1079
+ type: "select",
1080
+ options: BUMP_STRATEGIES,
1081
+ initial: defaultStrategy.value,
1082
+ cancel: "reject"
1083
+ });
1084
+ if (logger.level !== LogLevels.verbose) logger.log("");
1085
+ return wrapPromise(prompt).andTee(() => {
1086
+ if (logger.level === LogLevels.verbose) logger.log("");
1087
+ }).andThen((selected) => {
1088
+ if (!selected || selected === "") return invalidErrAsync({ message: "No version bump strategy selected" });
1089
+ const validationResult = validateStrategy(selected);
1090
+ if (validationResult.isErr()) return FireflyErrAsync(validationResult.error);
1091
+ logger.verbose(`PromptBumpStrategyTask: Selected version bump strategy: '${selected}'`);
1092
+ return FireflyOkAsync(selected);
1093
+ });
1094
+ }
1045
1095
  function createPromptBumpStrategyTask() {
1046
- return TaskBuilder.create("prompt-bump-strategy").description("Prompts the user for a version bump strategy").dependsOn("initialize-release-version").skipWhenWithReason((ctx) => ctx.config.skipBump || Boolean(ctx.config.bumpStrategy) || Boolean(ctx.config.releaseType), "Skipped: skipBump enabled, or bumpStrategy/releaseType already specified").execute((ctx) => {
1047
- logger.info("prompt-bump-strategy");
1048
- return FireflyOkAsync(ctx);
1049
- }).build();
1096
+ return TaskBuilder.create("prompt-bump-strategy").description("Prompts the user for a version bump strategy").dependsOn("initialize-release-version").skipWhenWithReason((ctx) => ctx.config.skipBump || Boolean(ctx.config.bumpStrategy) || Boolean(ctx.config.releaseType), "Skipped: skipBump enabled, or bumpStrategy/releaseType already specified").execute((ctx) => promptBumpStrategy().andThen((strategy) => FireflyOkAsync(ctx.fork("selectedBumpStrategy", strategy)))).build();
1050
1097
  }
1051
1098
 
1052
1099
  //#endregion
1053
1100
  //#region src/commands/release/tasks/prompt-manual-bump.task.ts
1054
1101
  function createPromptManualVersionTask() {
1055
- return TaskBuilder.create("prompt-manual-version").description("Prompts the user for a manual version bump selections").dependsOn("delegate-bump-strategy").skipWhenWithReason((ctx) => ctx.config.skipBump || Boolean(ctx.config.bumpStrategy) || Boolean(ctx.config.releaseType), "Skipped: skipBump enabled, or bumpStrategy/releaseType already specified").execute((ctx) => {
1102
+ return TaskBuilder.create("prompt-manual-version").description("Prompts the user for a manual version bump selections").dependsOn("delegate-bump-strategy").skipWhenWithReason((ctx) => {
1103
+ const bumpStrategy = ctx.data.selectedBumpStrategy ?? ctx.config.bumpStrategy;
1104
+ return ctx.config.skipBump || bumpStrategy !== BUMP_STRATEGY_MANUAL;
1105
+ }, "Skipped: skipBump enabled or bumpStrategy is not 'manual'").execute((ctx) => {
1056
1106
  logger.info("prompt-manual-version");
1057
1107
  return FireflyOkAsync(ctx);
1058
1108
  }).build();
@@ -1091,11 +1141,36 @@ function createBumpStrategyGroup() {
1091
1141
 
1092
1142
  //#endregion
1093
1143
  //#region src/commands/release/tasks/initialize-release-version.task.ts
1144
+ const PACKAGE_JSON_FILE = "package.json";
1145
+ /**
1146
+ * Reads package.json and extracts the version field.
1147
+ *
1148
+ * Behavior:
1149
+ * - Reads the configured package.json file.
1150
+ * - If the version property is missing, returns a validation error.
1151
+ * - Otherwise resolves with the version string.
1152
+ */
1153
+ function getVersionFromPackageJson(ctx) {
1154
+ return ctx.services.packageJson.read(PACKAGE_JSON_FILE).andThen((pkg) => {
1155
+ const version = pkg.version;
1156
+ if (!version) return validationErrAsync({ message: "The 'version' field is missing in package.json." });
1157
+ logger.verbose(`InitializeReleaseVersionTask: Prepared current version: ${version}`);
1158
+ return FireflyOkAsync(version);
1159
+ });
1160
+ }
1161
+ /**
1162
+ * Creates the Initialize Release Version task.
1163
+ *
1164
+ * This task initializes the current release version by reading it from package.json.
1165
+ *
1166
+ * This task:
1167
+ * 1. Reads the version from package.json
1168
+ */
1094
1169
  function createInitializeReleaseVersion() {
1095
- return TaskBuilder.create("initialize-release-version").description("Hydrate and prepare the release configuration").dependsOn("prepare-release-config").execute((ctx) => {
1096
- logger.info("initialize-release-version");
1097
- return FireflyOkAsync(ctx);
1098
- }).build();
1170
+ return TaskBuilder.create("initialize-release-version").description("Initialize current release version from package.json").dependsOn("prepare-release-config").execute((ctx) => getVersionFromPackageJson(ctx).andThen((currentVersion) => {
1171
+ logger.info(`Current version is ${currentVersion}`);
1172
+ return FireflyOkAsync(ctx.fork("currentVersion", currentVersion));
1173
+ })).build();
1099
1174
  }
1100
1175
 
1101
1176
  //#endregion
@@ -1160,12 +1235,12 @@ function extractPreReleaseId(version) {
1160
1235
  * - Parses the URL and returns "owner/repo" when possible.
1161
1236
  */
1162
1237
  function hydrateRepository(ctx) {
1163
- return ctx.services.git.inferRepositoryUrl().map((url) => {
1164
- if (!url) return null;
1238
+ return ctx.services.git.inferRepositoryUrl().andThen((url) => {
1239
+ if (!url) return validationErrAsync({ message: "Could not determine git remote URL to infer repository information" });
1165
1240
  const parsed = parseGitRemoteUrl(url);
1166
- if (parsed) return `${parsed.owner}/${parsed.repo}`;
1167
- return null;
1168
- }).map((val) => val ?? void 0).andTee((repository) => logger.verbose(`PrepareReleaseConfigTask: Prepared repository: ${repository}`));
1241
+ if (parsed) return FireflyOkAsync(`${parsed.owner}/${parsed.repo}`);
1242
+ return validationErrAsync({ message: `Could not parse repository information from git remote URL: ${url}` });
1243
+ }).andTee((repository) => logger.verbose(`PrepareReleaseConfigTask: Prepared repository: ${repository}`));
1169
1244
  }
1170
1245
  /**
1171
1246
  * Hydrates name, scope, and preReleaseId from package.json.
@@ -1586,21 +1661,41 @@ function defineService(definition) {
1586
1661
  */
1587
1662
  const SERVICE_DEFINITIONS = {
1588
1663
  fs: defineService({ factory: async ({ basePath }) => {
1589
- const { createFileSystemService } = await import("./filesystem.service-BeY7DXz3.js");
1664
+ const { createFileSystemService } = await import("./filesystem.service-Bl5h9T_0.js");
1590
1665
  return createFileSystemService(basePath);
1591
1666
  } }),
1592
1667
  packageJson: defineService({
1593
1668
  dependencies: ["fs"],
1594
1669
  factory: async ({ getService }) => {
1595
1670
  const fs = await getService("fs");
1596
- const { createPackageJsonService } = await import("./package-json.service-QN7SzRTt.js");
1671
+ const { createPackageJsonService } = await import("./package-json.service-B6ultpL4.js");
1597
1672
  return createPackageJsonService(fs);
1598
1673
  }
1599
1674
  }),
1600
1675
  git: defineService({ factory: async ({ basePath }) => {
1601
- const { createGitService } = await import("./git.service-DarjfyXF.js");
1676
+ const { createGitService } = await import("./git.service-C0qRXy1s.js");
1602
1677
  return createGitService(basePath);
1603
- } })
1678
+ } }),
1679
+ versionBumper: defineService({ factory: async () => {
1680
+ const { createVersionBumperService } = await import("./version-bumper.service-BYsIFCpv.js");
1681
+ return createVersionBumperService();
1682
+ } }),
1683
+ versionStrategy: defineService({
1684
+ dependencies: ["versionBumper"],
1685
+ factory: async ({ getService }) => {
1686
+ const versionBumper = await getService("versionBumper");
1687
+ const { createVersionStrategyService } = await import("./version-strategy.service-Ds4mvlDC.js");
1688
+ return createVersionStrategyService(versionBumper);
1689
+ }
1690
+ }),
1691
+ commitAnalysis: defineService({
1692
+ dependencies: ["git"],
1693
+ factory: async ({ getService }) => {
1694
+ const git = await getService("git");
1695
+ const { createCommitAnalysisService } = await import("./commit-analysis.service-BNlHyyhC.js");
1696
+ return createCommitAnalysisService(git);
1697
+ }
1698
+ })
1604
1699
  };
1605
1700
  /**
1606
1701
  * Array of all service keys for iteration
@@ -2239,7 +2334,11 @@ var WorkflowExecutor = class {
2239
2334
  const startTime = /* @__PURE__ */ new Date();
2240
2335
  const executedTaskIds = [];
2241
2336
  const skippedTaskIds = [];
2242
- if (this.options.dryRun) logger.warn("Workflow executing in DRY RUN mode - no actual changes will be made");
2337
+ if (this.options.dryRun) logger.warn("Running in DRY-RUN mode: No changes will be made.");
2338
+ const version = RuntimeEnv.version;
2339
+ const dashIndex = version.indexOf("-");
2340
+ if (dashIndex !== -1) if (dashIndex === version.length - 1 || version[dashIndex + 1] === "n") logger.warn(`You are running a DEVELOPMENT build of Firefly (${colors.dim(version)}). This is a 'next' build and may be unstable.`);
2341
+ else logger.warn(`You are running a PRE-RELEASE version of Firefly (${colors.dim(version)}). Unexpected behavior or bugs may occur.`);
2243
2342
  logger.verbose(`WorkflowExecutor: Starting execution of ${tasks.length} tasks`);
2244
2343
  return this.executeTasksSequentially(tasks, initialContext, executedTaskIds, skippedTaskIds).andThen(() => this.buildExecutionSuccessResult(startTime, executedTaskIds, skippedTaskIds)).orElse((error) => this.handleExecutionFailure({
2245
2344
  error,
@@ -253,9 +253,13 @@ const failedErrAsync = (opts) => errAsync(failedError(opts));
253
253
  */
254
254
  const invalidErr = (opts) => err(invalidError(opts));
255
255
  /**
256
+ * Creates an async invalid error result.
257
+ */
258
+ const invalidErrAsync = (opts) => errAsync(invalidError(opts));
259
+ /**
256
260
  * Creates an async timeout error result.
257
261
  */
258
262
  const timeoutErrAsync = (opts) => errAsync(timeoutError(opts));
259
263
 
260
264
  //#endregion
261
- export { validationError as _, conflictErrAsync as a, notFoundErrAsync as c, validationErrAsync as d, conflictError as f, toFireflyError as g, notFoundError as h, FireflyOkAsync as i, timeoutErrAsync as l, failedError as m, FireflyErrAsync as n, failedErrAsync as o, createFireflyError as p, FireflyOk as r, invalidErr as s, FireflyErr as t, validationErr as u, wrapErrorMessage as v };
265
+ export { notFoundError as _, conflictErrAsync as a, wrapErrorMessage as b, invalidErrAsync as c, validationErr as d, validationErrAsync as f, invalidError as g, failedError as h, FireflyOkAsync as i, notFoundErrAsync as l, createFireflyError as m, FireflyErrAsync as n, failedErrAsync as o, conflictError as p, FireflyOk as r, invalidErr as s, FireflyErr as t, timeoutErrAsync as u, toFireflyError as v, validationError as y };
@@ -1,4 +1,4 @@
1
- import { d as validationErrAsync, g as toFireflyError, i as FireflyOkAsync, p as createFireflyError } from "./result.constructors-C9M1MP3_.js";
1
+ import { f as validationErrAsync, i as FireflyOkAsync, m as createFireflyError, v as toFireflyError } from "./result.constructors-D9jmQ0uj.js";
2
2
  import { ResultAsync } from "neverthrow";
3
3
 
4
4
  //#region src/core/result/result.utilities.ts
@@ -1,4 +1,4 @@
1
- import { g as toFireflyError, p as createFireflyError, r as FireflyOk, t as FireflyErr } from "./result.constructors-C9M1MP3_.js";
1
+ import { m as createFireflyError, r as FireflyOk, t as FireflyErr, v as toFireflyError } from "./result.constructors-D9jmQ0uj.js";
2
2
  import { ResultAsync } from "neverthrow";
3
3
  import z$1 from "zod";
4
4