codemodctl 0.1.29 → 0.1.31
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
|
@@ -7,14 +7,6 @@ import { $ } from "execa";
|
|
|
7
7
|
import { writeFile } from "node:fs/promises";
|
|
8
8
|
|
|
9
9
|
//#region src/commands/git/create-pr.ts
|
|
10
|
-
function logExecError(message, error) {
|
|
11
|
-
console.error(message);
|
|
12
|
-
if (error && typeof error === "object" && "stderr" in error) {
|
|
13
|
-
const execError = error;
|
|
14
|
-
if (execError.stderr) console.error(execError.stderr);
|
|
15
|
-
if (execError.stdout) console.error(execError.stdout);
|
|
16
|
-
} else console.error(error instanceof Error ? error.message : String(error));
|
|
17
|
-
}
|
|
18
10
|
const createPrCommand = defineCommand({
|
|
19
11
|
meta: {
|
|
20
12
|
name: "create-pr",
|
|
@@ -95,7 +87,8 @@ const createPrCommand = defineCommand({
|
|
|
95
87
|
try {
|
|
96
88
|
remoteBaseBranch = (await $`git remote show origin`).stdout.match(/HEAD branch: (.+)/)?.[1]?.trim() || "main";
|
|
97
89
|
} catch (error) {
|
|
98
|
-
|
|
90
|
+
console.error("Error: Failed to get remote base branch");
|
|
91
|
+
console.error(error);
|
|
99
92
|
process.exit(1);
|
|
100
93
|
}
|
|
101
94
|
if (codemodBranchName) prData.head = codemodBranchName;
|
|
@@ -104,19 +97,22 @@ const createPrCommand = defineCommand({
|
|
|
104
97
|
try {
|
|
105
98
|
await $`git checkout -b ${codemodBranchName}`;
|
|
106
99
|
} catch (error) {
|
|
107
|
-
|
|
100
|
+
console.error("Error: Failed to checkout branch");
|
|
101
|
+
console.error(error);
|
|
108
102
|
process.exit(1);
|
|
109
103
|
}
|
|
110
104
|
try {
|
|
111
105
|
await $`git add .`;
|
|
112
106
|
} catch (error) {
|
|
113
|
-
|
|
107
|
+
console.error("Error: Failed to add changes");
|
|
108
|
+
console.error(error);
|
|
114
109
|
process.exit(1);
|
|
115
110
|
}
|
|
116
111
|
try {
|
|
117
112
|
await $`git commit --no-verify -m ${commitMessage}`;
|
|
118
113
|
} catch (error) {
|
|
119
|
-
|
|
114
|
+
console.error("Error: Failed to commit changes");
|
|
115
|
+
console.error(error);
|
|
120
116
|
process.exit(1);
|
|
121
117
|
}
|
|
122
118
|
try {
|
|
@@ -126,11 +122,9 @@ const createPrCommand = defineCommand({
|
|
|
126
122
|
} : {} })`git push origin ${codemodBranchName} --force`;
|
|
127
123
|
console.log(`Pushed branch to origin: ${codemodBranchName}`);
|
|
128
124
|
} catch (error) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
process.exit(1);
|
|
133
|
-
}
|
|
125
|
+
console.error("Error: Failed to push changes");
|
|
126
|
+
console.error(error);
|
|
127
|
+
process.exit(1);
|
|
134
128
|
}
|
|
135
129
|
}
|
|
136
130
|
if (body) prData.body = body;
|
|
@@ -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",
|
package/dist/codeowners.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as getApplicableFiles } from "./codemod-cli-
|
|
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";
|
package/dist/directory.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as getApplicableFiles } from "./codemod-cli-
|
|
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.
|
|
3
|
+
"version": "0.1.31",
|
|
4
4
|
"description": "CLI tool and utilities for workflow engine operations, file sharding, and codeowner analysis",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"bin": {
|
|
21
|
-
"codemodctl": "./dist/cli.
|
|
21
|
+
"codemodctl": "./dist/cli.mjs"
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
24
|
"dist"
|