fireflyy 4.0.0-dev.352994a → 4.0.0-dev.644fea9

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
+ import { t as logger } from "./main.js";
1
2
  import { c as notFoundErrAsync } from "./result.constructors-C9M1MP3_.js";
2
- import { n as wrapPromise } from "./result.utilities-B03Jkhlx.js";
3
+ import { n as wrapPromise } from "./result.utilities-DC5shlhT.js";
3
4
  import { t as withDryRun } from "./dry-run-BfYCtldz.js";
4
5
 
5
6
  //#region src/services/implementations/filesystem.service.ts
@@ -29,21 +30,18 @@ var DefaultFileSystemService = class {
29
30
  }
30
31
  exists(path) {
31
32
  const resolved = this.resolvePath(path);
32
- return wrapPromise(Bun.file(resolved).exists());
33
+ return wrapPromise(Bun.file(resolved).exists()).andTee(() => logger.verbose(`DefaultFileSystemService: Checked existence of file: ${resolved}`));
33
34
  }
34
35
  read(path) {
35
36
  const resolved = this.resolvePath(path);
36
37
  const file = Bun.file(resolved);
37
38
  return wrapPromise(file.exists()).andThen((fileExists) => {
38
- if (!fileExists) return notFoundErrAsync({
39
- message: `File not found: ${resolved}`,
40
- source: "FileSystemService.read"
41
- });
42
- return wrapPromise(file.text());
39
+ if (!fileExists) return notFoundErrAsync({ message: `File not found: ${resolved}` });
40
+ return wrapPromise(file.text()).andTee(() => logger.verbose(`DefaultFileSystemService: Read file: ${resolved}`));
43
41
  });
44
42
  }
45
43
  write(path, content, options) {
46
- return withDryRun(options, `Writing to ${this.resolvePath(path)}`, () => wrapPromise(Bun.write(this.resolvePath(path), content).then(() => {})));
44
+ return withDryRun(options, `Writing to ${this.resolvePath(path)}`, () => wrapPromise(Bun.write(this.resolvePath(path), content).then(() => {})).andTee(() => logger.verbose(`DefaultFileSystemService: Wrote file: ${this.resolvePath(path)}`)));
47
45
  }
48
46
  };
49
47
  /**
@@ -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.352994a";
74
+ var version = "4.0.0-dev.644fea9";
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-DSPj4l5A.js");
102
+ const { createFireflyCLI } = await import("./program-CHc5t2Xm.js");
103
103
  createFireflyCLI().parseAsync(process.argv).catch((error) => {
104
104
  logger.error("Fatal error:", error);
105
105
  process.exit(1);
@@ -1,3 +1,4 @@
1
+ import { t as logger } from "./main.js";
1
2
  import { d as validationErrAsync, g as toFireflyError, i as FireflyOkAsync, u as validationErr } from "./result.constructors-C9M1MP3_.js";
2
3
  import { n as parseSchema } from "./schema.utilities-BGd9t1wm.js";
3
4
  import { Result } from "neverthrow";
@@ -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,6 +1,6 @@
1
1
  import { n as RuntimeEnv, t as logger } from "./main.js";
2
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-B03Jkhlx.js";
3
+ import { n as wrapPromise, r as zip3Async, t as ensureNotAsync } from "./result.utilities-DC5shlhT.js";
4
4
  import { n as parseSchema, t as formatZodErrors } from "./schema.utilities-BGd9t1wm.js";
5
5
  import { LogLevels } from "consola";
6
6
  import { colors } from "consola/utils";
@@ -1091,11 +1091,36 @@ function createBumpStrategyGroup() {
1091
1091
 
1092
1092
  //#endregion
1093
1093
  //#region src/commands/release/tasks/initialize-release-version.task.ts
1094
+ const PACKAGE_JSON_FILE = "package.json";
1095
+ /**
1096
+ * Reads package.json and extracts the version field.
1097
+ *
1098
+ * Behavior:
1099
+ * - Reads the configured package.json file.
1100
+ * - If the version property is missing, returns a validation error.
1101
+ * - Otherwise resolves with the version string.
1102
+ */
1103
+ function getVersionFromPackageJson(ctx) {
1104
+ return ctx.services.packageJson.read(PACKAGE_JSON_FILE).andThen((pkg) => {
1105
+ const version = pkg.version;
1106
+ if (!version) return validationErrAsync({ message: "The 'version' field is missing in package.json." });
1107
+ logger.verbose(`InitializeReleaseVersionTask: Prepared current version: ${version}`);
1108
+ return FireflyOkAsync(version);
1109
+ });
1110
+ }
1111
+ /**
1112
+ * Creates the Initialize Release Version task.
1113
+ *
1114
+ * This task initializes the current release version by reading it from package.json.
1115
+ *
1116
+ * This task:
1117
+ * 1. Reads the version from package.json
1118
+ */
1094
1119
  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();
1120
+ return TaskBuilder.create("initialize-release-version").description("Initialize current release version from package.json").dependsOn("prepare-release-config").execute((ctx) => getVersionFromPackageJson(ctx).andThen((currentVersion) => {
1121
+ logger.info(`Current version is ${currentVersion}`);
1122
+ return FireflyOkAsync(ctx.fork("currentVersion", currentVersion));
1123
+ })).build();
1099
1124
  }
1100
1125
 
1101
1126
  //#endregion
@@ -1586,19 +1611,19 @@ function defineService(definition) {
1586
1611
  */
1587
1612
  const SERVICE_DEFINITIONS = {
1588
1613
  fs: defineService({ factory: async ({ basePath }) => {
1589
- const { createFileSystemService } = await import("./filesystem.service-DdVwnqoa.js");
1614
+ const { createFileSystemService } = await import("./filesystem.service-9VHML130.js");
1590
1615
  return createFileSystemService(basePath);
1591
1616
  } }),
1592
1617
  packageJson: defineService({
1593
1618
  dependencies: ["fs"],
1594
1619
  factory: async ({ getService }) => {
1595
1620
  const fs = await getService("fs");
1596
- const { createPackageJsonService } = await import("./package-json.service-QN7SzRTt.js");
1621
+ const { createPackageJsonService } = await import("./package-json.service-DACeZzRg.js");
1597
1622
  return createPackageJsonService(fs);
1598
1623
  }
1599
1624
  }),
1600
1625
  git: defineService({ factory: async ({ basePath }) => {
1601
- const { createGitService } = await import("./git.service-DarjfyXF.js");
1626
+ const { createGitService } = await import("./git.service-CACrfCW8.js");
1602
1627
  return createGitService(basePath);
1603
1628
  } })
1604
1629
  };
@@ -1,5 +1,5 @@
1
1
  import { d as validationErrAsync, g as toFireflyError, i as FireflyOkAsync, p as createFireflyError } from "./result.constructors-C9M1MP3_.js";
2
- import { ResultAsync, okAsync } from "neverthrow";
2
+ import { ResultAsync } from "neverthrow";
3
3
 
4
4
  //#region src/core/result/result.utilities.ts
5
5
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fireflyy",
3
- "version": "4.0.0-dev.352994a",
3
+ "version": "4.0.0-dev.644fea9",
4
4
  "description": " CLI orchestrator for automatic semantic versioning, changelog generation, and creating releases. Built for my own use cases.",
5
5
  "type": "module",
6
6
  "license": "MIT",