codemodctl 0.1.30 → 0.1.32

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.
package/dist/cli.mjs CHANGED
@@ -85,11 +85,13 @@ const createPrCommand = defineCommand({
85
85
  const codemodBranchName = branchName ? branchName : `codemod-${taskIdSignature}`;
86
86
  let remoteBaseBranch;
87
87
  try {
88
- remoteBaseBranch = (await $`git remote show origin`).stdout.match(/HEAD branch: (.+)/)?.[1]?.trim() || "main";
89
- } catch (error) {
90
- console.error("Error: Failed to get remote base branch");
91
- console.error(error);
92
- process.exit(1);
88
+ remoteBaseBranch = (await $`git symbolic-ref refs/remotes/origin/HEAD --short`).stdout.trim().replace(/^origin\//, "");
89
+ } catch {
90
+ try {
91
+ remoteBaseBranch = (await $`git rev-parse --abbrev-ref HEAD`).stdout.trim();
92
+ } catch {
93
+ remoteBaseBranch = "main";
94
+ }
93
95
  }
94
96
  if (codemodBranchName) prData.head = codemodBranchName;
95
97
  if (remoteBaseBranch) prData.base = remoteBaseBranch;
@@ -7,7 +7,7 @@ import { execSync } from "node:child_process";
7
7
  */
8
8
  async function getApplicableFiles(rulePath, language, projectRoot) {
9
9
  try {
10
- const command = `npx -y codemod@latest jssg list-applicable --allow-fs --allow-fetch --allow-child-process --language ${language} --target ${projectRoot} ${rulePath}`;
10
+ const command = `npx -y codemod@latest jssg list-applicable --allow-fs --allow-fetch --allow-child-process --language ${language} --target ${projectRoot} "${rulePath}"`;
11
11
  console.debug(`Executing: ${command}`);
12
12
  const applicableFiles = execSync(command, {
13
13
  encoding: "utf8",
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as getApplicableFiles } from "./codemod-cli-D-ormE6R.mjs";
2
+ import { t as getApplicableFiles } from "./codemod-cli-DLIYSosY.mjs";
3
3
  import Codeowners from "codeowners";
4
4
  import { existsSync } from "node:fs";
5
5
  import path, { resolve } from "node:path";
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as getApplicableFiles } from "./codemod-cli-D-ormE6R.mjs";
2
+ import { t as getApplicableFiles } from "./codemod-cli-DLIYSosY.mjs";
3
3
  import { calculateOptimalShardCount, distributeFilesAcrossShards } from "./sharding.mjs";
4
4
  import path from "node:path";
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codemodctl",
3
- "version": "0.1.30",
3
+ "version": "0.1.32",
4
4
  "description": "CLI tool and utilities for workflow engine operations, file sharding, and codeowner analysis",
5
5
  "type": "module",
6
6
  "exports": {