codeowners-git 1.3.0 → 1.4.0

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.
Files changed (3) hide show
  1. package/README.md +12 -0
  2. package/dist/cli.js +12 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -48,6 +48,18 @@ The tool automatically detects CODEOWNERS files in:
48
48
 
49
49
  ## Commands
50
50
 
51
+ ### `--version`
52
+
53
+ Display the version of codeowners-git.
54
+
55
+ Usage:
56
+
57
+ ```bash
58
+ codeowners-git --version
59
+ # or
60
+ codeowners-git -V
61
+ ```
62
+
51
63
  ### `list`
52
64
 
53
65
  List current CODEOWNERS entries.
package/dist/cli.js CHANGED
@@ -14946,9 +14946,20 @@ var multiBranch = async (options) => {
14946
14946
  }
14947
14947
  };
14948
14948
 
14949
+ // src/commands/version.ts
14950
+ import { readFileSync } from "fs";
14951
+ import { fileURLToPath } from "url";
14952
+ import { dirname, join } from "path";
14953
+ function getVersion() {
14954
+ const __filename2 = fileURLToPath(import.meta.url);
14955
+ const __dirname2 = dirname(__filename2);
14956
+ const packageJson = JSON.parse(readFileSync(join(__dirname2, "../../package.json"), "utf8"));
14957
+ return packageJson.version;
14958
+ }
14959
+
14949
14960
  // src/cli.ts
14950
14961
  var program2 = new Command;
14951
- program2.name("codeowners").description("CLI tool for grouping and managing staged files by CODEOWNERS");
14962
+ program2.name("codeowners").description("CLI tool for grouping and managing staged files by CODEOWNERS").version(getVersion());
14952
14963
  program2.command("list").description("Lists all git changed files by CODEOWNER").option("-o, --owner <owner>", "Filter by specific code owner").option("-i, --include <patterns>", "Filter by owner patterns").action(listCodeowners);
14953
14964
  program2.command("branch").description("Create new branch with codeowner changes").requiredOption("-o, --owner <owner>", "Code owner name").requiredOption("-b, --branch <branch>", "Branch name").requiredOption("-m, --message <message>", "Commit message").option("-n, --no-verify", "Skip lint-staged or any other ci checks").option("-p, --push", "Push branch to remote after commit").option("-r, --remote <remote>", "Remote name to push to", "origin").option("-u, --upstream <upstream>", "Upstream branch name (defaults to local branch name)").option("-f, --force", "Force push to remote").option("-k, --keep-branch-on-failure", "Keep the created branch even if operation fails").action(branch);
14954
14965
  program2.command("multi-branch").description("Create branches for all codeowners").requiredOption("-b, --branch <branch>", "Base branch name (will be suffixed with codeowner name)").requiredOption("-m, --message <message>", "Base commit message (will be suffixed with codeowner name)").option("-n, --no-verify", "Skip lint-staged or any other ci checks").option("-p, --push", "Push branches to remote after commit").option("-r, --remote <remote>", "Remote name to push to", "origin").option("-u, --upstream <upstream>", "Upstream branch name pattern (defaults to local branch name)").option("-f, --force", "Force push to remote").option("-k, --keep-branch-on-failure", "Keep created branches even if operation fails").option("-d, --default-owner <defaultOwner>", "Default owner to use when no codeowners are found for changed files").option("--ignore <patterns>", "Comma-separated patterns to exclude codeowners (e.g., 'team-a,team-b')").option("--include <patterns>", "Comma-separated patterns to include codeowners (e.g., 'team-*,@org/*')").action(multiBranch);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeowners-git",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "module": "src/cli.ts",
5
5
  "type": "module",
6
6
  "private": false,