@releasekit/version 0.7.11 → 0.7.12

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.
@@ -580,6 +580,23 @@ function printJsonOutput() {
580
580
  }
581
581
  }
582
582
 
583
+ // src/core/versionCalculator.ts
584
+ import { cwd } from "process";
585
+ import { Bumper } from "conventional-recommended-bump";
586
+ import semver3 from "semver";
587
+
588
+ // src/git/repository.ts
589
+ import { existsSync as existsSync3, statSync } from "fs";
590
+ import { join as join3 } from "path";
591
+ function getCurrentBranch() {
592
+ const result = execSync("git", ["rev-parse", "--abbrev-ref", "HEAD"]);
593
+ return result.toString().trim();
594
+ }
595
+
596
+ // src/git/tagsAndBranches.ts
597
+ import { getSemverTags } from "git-semver-tags";
598
+ import semver from "semver";
599
+
583
600
  // src/utils/logging.ts
584
601
  import chalk from "chalk";
585
602
  import figlet from "figlet";
@@ -617,23 +634,6 @@ function log(message, level = "info") {
617
634
  }
618
635
  }
619
636
 
620
- // src/core/versionCalculator.ts
621
- import { cwd } from "process";
622
- import { Bumper } from "conventional-recommended-bump";
623
- import semver3 from "semver";
624
-
625
- // src/git/repository.ts
626
- import { existsSync as existsSync3, statSync } from "fs";
627
- import { join as join3 } from "path";
628
- function getCurrentBranch() {
629
- const result = execSync("git", ["rev-parse", "--abbrev-ref", "HEAD"]);
630
- return result.toString().trim();
631
- }
632
-
633
- // src/git/tagsAndBranches.ts
634
- import { getSemverTags } from "git-semver-tags";
635
- import semver from "semver";
636
-
637
637
  // src/utils/formatting.ts
638
638
  function escapeRegExp(string) {
639
639
  return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
@@ -1469,7 +1469,7 @@ function extractIssueIds(body) {
1469
1469
  }
1470
1470
 
1471
1471
  // src/utils/packageMatching.ts
1472
- import micromatch from "micromatch";
1472
+ import { minimatch } from "minimatch";
1473
1473
  function matchesPackageTarget(packageName, target) {
1474
1474
  if (packageName === target) {
1475
1475
  return true;
@@ -1479,12 +1479,8 @@ function matchesPackageTarget(packageName, target) {
1479
1479
  return packageName.startsWith(`${scope}/`);
1480
1480
  }
1481
1481
  try {
1482
- return micromatch.isMatch(packageName, target, {
1483
- dot: true,
1484
- contains: false,
1485
- // Changed to false to ensure full pattern matching
1486
- noglobstar: false,
1487
- bash: true
1482
+ return minimatch(packageName, target, {
1483
+ dot: true
1488
1484
  });
1489
1485
  } catch (error) {
1490
1486
  log(`Invalid pattern "${target}": ${error instanceof Error ? error.message : String(error)}`, "warning");
@@ -2291,7 +2287,7 @@ var GitError = class extends BaseVersionError {
2291
2287
 
2292
2288
  // src/utils/packageFiltering.ts
2293
2289
  import path9 from "path";
2294
- import micromatch2 from "micromatch";
2290
+ import { minimatch as minimatch2 } from "minimatch";
2295
2291
  function filterPackagesByConfig(packages, configTargets, workspaceRoot) {
2296
2292
  if (configTargets.length === 0) {
2297
2293
  log("No config targets specified, returning all packages", "debug");
@@ -2322,10 +2318,8 @@ function filterByDirectoryPattern(packages, pattern, workspaceRoot) {
2322
2318
  return true;
2323
2319
  }
2324
2320
  try {
2325
- return micromatch2.isMatch(normalizedRelativePath, normalizedPattern, {
2326
- dot: true,
2327
- noglobstar: false,
2328
- bash: true
2321
+ return minimatch2(normalizedRelativePath, normalizedPattern, {
2322
+ dot: true
2329
2323
  });
2330
2324
  } catch (error) {
2331
2325
  log(
@@ -2353,11 +2347,8 @@ function matchesPackageNamePattern(packageName, pattern) {
2353
2347
  return packageName.startsWith(`${scope}/`);
2354
2348
  }
2355
2349
  try {
2356
- return micromatch2.isMatch(packageName, pattern, {
2357
- dot: true,
2358
- contains: false,
2359
- noglobstar: false,
2360
- bash: true
2350
+ return minimatch2(packageName, pattern, {
2351
+ dot: true
2361
2352
  });
2362
2353
  } catch (error) {
2363
2354
  log(
@@ -2463,6 +2454,80 @@ var VersionEngine = class {
2463
2454
  }
2464
2455
  };
2465
2456
 
2457
+ // src/command.ts
2458
+ import { Command } from "commander";
2459
+ function createVersionCommand() {
2460
+ return new Command("version").description("Version a package or packages based on configuration").option("-c, --config <path>", "Path to config file (defaults to releasekit.config.json in current directory)").option("-d, --dry-run", "Dry run (no changes made)", false).option("-b, --bump <type>", "Specify bump type (patch|minor|major)").option("-p, --prerelease [identifier]", "Create prerelease version").option("-s, --sync", "Use synchronized versioning across all packages").option("-j, --json", "Output results as JSON", false).option("-t, --target <packages>", "Comma-delimited list of package names to target").option("--project-dir <path>", "Project directory to run commands in", process.cwd()).action(async (options) => {
2461
+ if (options.json) {
2462
+ enableJsonOutput(options.dryRun);
2463
+ }
2464
+ try {
2465
+ const originalCwd = process.cwd();
2466
+ if (options.projectDir && options.projectDir !== originalCwd) {
2467
+ try {
2468
+ process.chdir(options.projectDir);
2469
+ log(`Changed working directory to: ${options.projectDir}`, "debug");
2470
+ } catch (error) {
2471
+ throw new Error(
2472
+ `Failed to change to directory "${options.projectDir}": ${error instanceof Error ? error.message : String(error)}`
2473
+ );
2474
+ }
2475
+ }
2476
+ const config = loadConfig2({ cwd: options.projectDir, configPath: options.config });
2477
+ log(`Loaded configuration from ${options.config || "releasekit.config.json"}`, "info");
2478
+ if (options.dryRun) config.dryRun = true;
2479
+ if (options.sync) config.sync = true;
2480
+ if (options.bump) config.type = options.bump;
2481
+ if (options.prerelease) {
2482
+ config.prereleaseIdentifier = options.prerelease === true ? "next" : options.prerelease;
2483
+ config.isPrerelease = true;
2484
+ }
2485
+ const cliTargets = options.target ? options.target.split(",").map((t) => t.trim()) : [];
2486
+ if (cliTargets.length > 0) {
2487
+ config.packages = cliTargets;
2488
+ log(`CLI targets specified: ${cliTargets.join(", ")}`, "info");
2489
+ }
2490
+ const engine = new VersionEngine(config, !!options.json);
2491
+ const pkgsResult = await engine.getWorkspacePackages();
2492
+ const resolvedCount = pkgsResult.packages.length;
2493
+ log(`Resolved ${resolvedCount} packages from workspace`, "debug");
2494
+ log(`Config packages: ${JSON.stringify(config.packages)}`, "debug");
2495
+ log(`Config sync: ${config.sync}`, "debug");
2496
+ if (config.sync) {
2497
+ log("Using sync versioning strategy.", "info");
2498
+ engine.setStrategy("sync");
2499
+ await engine.run(pkgsResult);
2500
+ } else if (resolvedCount === 1) {
2501
+ log("Using single package versioning strategy.", "info");
2502
+ if (cliTargets.length > 0) {
2503
+ log("--target flag is ignored for single package strategy.", "warning");
2504
+ }
2505
+ engine.setStrategy("single");
2506
+ await engine.run(pkgsResult);
2507
+ } else if (resolvedCount === 0) {
2508
+ throw new Error("No packages found in workspace");
2509
+ } else {
2510
+ log("Using async versioning strategy.", "info");
2511
+ if (cliTargets.length > 0) {
2512
+ log(`Targeting specific packages: ${cliTargets.join(", ")}`, "info");
2513
+ }
2514
+ engine.setStrategy("async");
2515
+ await engine.run(pkgsResult, cliTargets);
2516
+ }
2517
+ log("Versioning process completed.", "success");
2518
+ printJsonOutput();
2519
+ } catch (error) {
2520
+ const { BaseVersionError: BaseVersionError2 } = await import("./baseError-DQHIJACF.js");
2521
+ if (BaseVersionError2.isVersionError(error)) {
2522
+ error.logError();
2523
+ } else {
2524
+ log(`Error: ${error instanceof Error ? error.message : String(error)}`, "error");
2525
+ }
2526
+ process.exit(1);
2527
+ }
2528
+ });
2529
+ }
2530
+
2466
2531
  export {
2467
2532
  loadConfig2 as loadConfig,
2468
2533
  VersionErrorCode,
@@ -2470,12 +2535,11 @@ export {
2470
2535
  enableJsonOutput,
2471
2536
  flushPendingWrites,
2472
2537
  getJsonData,
2473
- printJsonOutput,
2474
- log,
2475
2538
  calculateVersion,
2476
2539
  PackageProcessor,
2477
2540
  createSyncStrategy,
2478
2541
  createSingleStrategy,
2479
2542
  createAsyncStrategy,
2480
- VersionEngine
2543
+ VersionEngine,
2544
+ createVersionCommand
2481
2545
  };
package/dist/cli.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command } from 'commander';
3
+ export { createVersionCommand } from './command.ts';
3
4
 
4
- declare function createVersionCommand(): Command;
5
5
  declare function createVersionProgram(): Command;
6
6
 
7
- export { createVersionCommand, createVersionProgram };
7
+ export { createVersionProgram };
package/dist/cli.js CHANGED
@@ -1,11 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- VersionEngine,
4
- enableJsonOutput,
5
- loadConfig,
6
- log,
7
- printJsonOutput
8
- } from "./chunk-FG7SGZ7E.js";
3
+ createVersionCommand
4
+ } from "./chunk-UBCKZYTO.js";
9
5
  import {
10
6
  readPackageVersion
11
7
  } from "./chunk-Q3FHZORY.js";
@@ -15,77 +11,6 @@ import "./chunk-LMPZV35Z.js";
15
11
  import * as fs from "fs";
16
12
  import { fileURLToPath } from "url";
17
13
  import { Command } from "commander";
18
- function createVersionCommand() {
19
- return new Command("version").description("Version a package or packages based on configuration").option("-c, --config <path>", "Path to config file (defaults to releasekit.config.json in current directory)").option("-d, --dry-run", "Dry run (no changes made)", false).option("-b, --bump <type>", "Specify bump type (patch|minor|major)").option("-p, --prerelease [identifier]", "Create prerelease version").option("-s, --sync", "Use synchronized versioning across all packages").option("-j, --json", "Output results as JSON", false).option("-t, --target <packages>", "Comma-delimited list of package names to target").option("--project-dir <path>", "Project directory to run commands in", process.cwd()).action(async (options) => {
20
- if (options.json) {
21
- enableJsonOutput(options.dryRun);
22
- }
23
- try {
24
- const originalCwd = process.cwd();
25
- if (options.projectDir && options.projectDir !== originalCwd) {
26
- try {
27
- process.chdir(options.projectDir);
28
- log(`Changed working directory to: ${options.projectDir}`, "debug");
29
- } catch (error) {
30
- throw new Error(
31
- `Failed to change to directory "${options.projectDir}": ${error instanceof Error ? error.message : String(error)}`
32
- );
33
- }
34
- }
35
- const config = loadConfig({ cwd: options.projectDir, configPath: options.config });
36
- log(`Loaded configuration from ${options.config || "releasekit.config.json"}`, "info");
37
- if (options.dryRun) config.dryRun = true;
38
- if (options.sync) config.sync = true;
39
- if (options.bump) config.type = options.bump;
40
- if (options.prerelease) {
41
- config.prereleaseIdentifier = options.prerelease === true ? "next" : options.prerelease;
42
- config.isPrerelease = true;
43
- }
44
- const cliTargets = options.target ? options.target.split(",").map((t) => t.trim()) : [];
45
- if (cliTargets.length > 0) {
46
- config.packages = cliTargets;
47
- log(`CLI targets specified: ${cliTargets.join(", ")}`, "info");
48
- }
49
- const engine = new VersionEngine(config, !!options.json);
50
- const pkgsResult = await engine.getWorkspacePackages();
51
- const resolvedCount = pkgsResult.packages.length;
52
- log(`Resolved ${resolvedCount} packages from workspace`, "debug");
53
- log(`Config packages: ${JSON.stringify(config.packages)}`, "debug");
54
- log(`Config sync: ${config.sync}`, "debug");
55
- if (config.sync) {
56
- log("Using sync versioning strategy.", "info");
57
- engine.setStrategy("sync");
58
- await engine.run(pkgsResult);
59
- } else if (resolvedCount === 1) {
60
- log("Using single package versioning strategy.", "info");
61
- if (cliTargets.length > 0) {
62
- log("--target flag is ignored for single package strategy.", "warning");
63
- }
64
- engine.setStrategy("single");
65
- await engine.run(pkgsResult);
66
- } else if (resolvedCount === 0) {
67
- throw new Error("No packages found in workspace");
68
- } else {
69
- log("Using async versioning strategy.", "info");
70
- if (cliTargets.length > 0) {
71
- log(`Targeting specific packages: ${cliTargets.join(", ")}`, "info");
72
- }
73
- engine.setStrategy("async");
74
- await engine.run(pkgsResult, cliTargets);
75
- }
76
- log("Versioning process completed.", "success");
77
- printJsonOutput();
78
- } catch (error) {
79
- const { BaseVersionError } = await import("./baseError-DQHIJACF.js");
80
- if (BaseVersionError.isVersionError(error)) {
81
- error.logError();
82
- } else {
83
- log(`Error: ${error instanceof Error ? error.message : String(error)}`, "error");
84
- }
85
- process.exit(1);
86
- }
87
- });
88
- }
89
14
  var isMain = (() => {
90
15
  try {
91
16
  return process.argv[1] ? fs.realpathSync(process.argv[1]) === fileURLToPath(import.meta.url) : false;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export { createVersionCommand } from './command.ts';
1
2
  export { loadConfig } from './config.ts';
2
3
  export { calculateVersion } from './core/versionCalculator.ts';
3
4
  export { VersionEngine } from './core/versionEngine.ts';
package/dist/index.js CHANGED
@@ -6,12 +6,13 @@ import {
6
6
  createAsyncStrategy,
7
7
  createSingleStrategy,
8
8
  createSyncStrategy,
9
+ createVersionCommand,
9
10
  createVersionError,
10
11
  enableJsonOutput,
11
12
  flushPendingWrites,
12
13
  getJsonData,
13
14
  loadConfig
14
- } from "./chunk-FG7SGZ7E.js";
15
+ } from "./chunk-UBCKZYTO.js";
15
16
  import {
16
17
  BaseVersionError
17
18
  } from "./chunk-Q3FHZORY.js";
@@ -25,6 +26,7 @@ export {
25
26
  createAsyncStrategy,
26
27
  createSingleStrategy,
27
28
  createSyncStrategy,
29
+ createVersionCommand,
28
30
  createVersionError,
29
31
  enableJsonOutput,
30
32
  flushPendingWrites,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@releasekit/version",
3
- "version": "0.7.11",
3
+ "version": "0.7.12",
4
4
  "description": "Semantic versioning based on Git history and conventional commits",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -49,7 +49,7 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@manypkg/get-packages": "^3.1.0",
52
- "@types/micromatch": "^4.0.10",
52
+ "@types/minimatch": "^5.1.2",
53
53
  "chalk": "^5.6.2",
54
54
  "commander": "^14.0.3",
55
55
  "conventional-changelog-angular": "^8.3.1",
@@ -59,7 +59,7 @@
59
59
  "conventional-recommended-bump": "^11.2.0",
60
60
  "figlet": "^1.11.0",
61
61
  "git-semver-tags": "^8.0.1",
62
- "micromatch": "^4.0.8",
62
+ "minimatch": "^10.2.5",
63
63
  "semver": "^7.7.4",
64
64
  "smol-toml": "^1.6.1",
65
65
  "zod": "^4.3.6"