gityo 1.1.9 → 1.1.10
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/{flow-DMdKWnY_.js → flow-Dt1FS1vI.js} +31 -3
- package/dist/index.js +3 -3
- package/dist/lib.js +1 -1
- package/package.json +1 -1
|
@@ -22404,6 +22404,19 @@ async function getCommitDiff(git, scope, contextLines = 3) {
|
|
|
22404
22404
|
file$4
|
|
22405
22405
|
])))].filter((part) => part.length > 0).join("\n");
|
|
22406
22406
|
}
|
|
22407
|
+
function countDiffLines(diff) {
|
|
22408
|
+
let additions = 0;
|
|
22409
|
+
let deletions = 0;
|
|
22410
|
+
let inHunk = false;
|
|
22411
|
+
for (const line of diff.split("\n")) if (line.startsWith("diff ")) inHunk = false;
|
|
22412
|
+
else if (line.startsWith("@@")) inHunk = true;
|
|
22413
|
+
else if (inHunk && line.startsWith("+")) additions++;
|
|
22414
|
+
else if (inHunk && line.startsWith("-")) deletions++;
|
|
22415
|
+
return {
|
|
22416
|
+
additions,
|
|
22417
|
+
deletions
|
|
22418
|
+
};
|
|
22419
|
+
}
|
|
22407
22420
|
function splitNull(output$3) {
|
|
22408
22421
|
return output$3.split("\0").filter(Boolean);
|
|
22409
22422
|
}
|
|
@@ -227294,8 +227307,13 @@ async function mainController(options = {}) {
|
|
|
227294
227307
|
const forceLLMGenerate = options.generate || options.yolo;
|
|
227295
227308
|
const forceExecPostCommand = options.post || options.yolo;
|
|
227296
227309
|
if (files.length === 0) return console.log("No changed files found.");
|
|
227297
|
-
console.log(source_default.dim(`${files.length} ${diffScope === "staged" ? "staged" : "changed"} file(s)`));
|
|
227298
227310
|
const diff = await getCommitDiff(git, diffScope);
|
|
227311
|
+
const lineCounts = countDiffLines(diff);
|
|
227312
|
+
console.log([
|
|
227313
|
+
source_default.dim(`${files.length} ${diffScope === "staged" ? "staged " : ""}${files.length === 1 ? "file" : "files"},`),
|
|
227314
|
+
source_default.green.dim(`+${lineCounts.additions}`),
|
|
227315
|
+
source_default.red.dim(`-${lineCounts.deletions}`)
|
|
227316
|
+
].join(" "));
|
|
227299
227317
|
if (finalCommitMessage.length > 0) {
|
|
227300
227318
|
console.log(source_default.yellow("✓ Using direct commit message"));
|
|
227301
227319
|
console.log(source_default.cyan.dim(finalCommitMessage));
|
|
@@ -234585,7 +234603,7 @@ async function loadPullRequestContext(cwd, options = {}) {
|
|
|
234585
234603
|
async function createPullRequest$1(options) {
|
|
234586
234604
|
const maxDiffTokens = options.maxDiffTokens ?? DEFAULT_MAX_DIFF_TOKENS;
|
|
234587
234605
|
const compare = await fetchPullRequestCompare(options.cwd, options.base, options.head);
|
|
234588
|
-
console.log(
|
|
234606
|
+
console.log(formatCompareSummary(compare));
|
|
234589
234607
|
const context = buildCompareContext(compare, maxDiffTokens);
|
|
234590
234608
|
let draft = "";
|
|
234591
234609
|
while (true) {
|
|
@@ -234607,6 +234625,16 @@ async function createPullRequest$1(options) {
|
|
|
234607
234625
|
console.log(pullRequest.url);
|
|
234608
234626
|
return pullRequest;
|
|
234609
234627
|
}
|
|
234628
|
+
function formatCompareSummary(compare) {
|
|
234629
|
+
const files = compare.files ?? [];
|
|
234630
|
+
const additions = files.reduce((total, file$4) => total + file$4.additions, 0);
|
|
234631
|
+
const deletions = files.reduce((total, file$4) => total + file$4.deletions, 0);
|
|
234632
|
+
return [
|
|
234633
|
+
source_default.dim(`${compare.commits.length} ${compare.commits.length === 1 ? "commit" : "commits"}, ${files.length} ${files.length === 1 ? "file" : "files"},`),
|
|
234634
|
+
source_default.green.dim(`+${additions}`),
|
|
234635
|
+
source_default.red.dim(`-${deletions}`)
|
|
234636
|
+
].join(" ");
|
|
234637
|
+
}
|
|
234610
234638
|
async function fetchPullRequestCompare(cwd, base$2, head$1) {
|
|
234611
234639
|
const compare = await fetchCompare(cwd, base$2, head$1);
|
|
234612
234640
|
if (compare.commits.length === 0) throw new Error(`No commits found between '${base$2}' and '${head$1}'.`);
|
|
@@ -234988,4 +235016,4 @@ async function publishRelease(cwd, input$3, replace, output$3) {
|
|
|
234988
235016
|
if (replace) await deleteRelease(cwd, input$3.tag, output$3);
|
|
234989
235017
|
await createRelease(cwd, input$3, output$3);
|
|
234990
235018
|
}
|
|
234991
|
-
export {
|
|
235019
|
+
export { mainController as A, COMMIT_STYLE_PROMPTS as B, generatePullRequest as C, mergePullRequest as D, getDefaultBranch as E, mergeTheme as F, getGit as G, PR_TITLE_PROMPTS as H, selectionTheme as I, dist_default as J, source_default as K, GLOBAL_CONFIG_FILE_PATH as L, writeCommitMessage as M, runWithLoading as N, openPullRequest as O, acceptGenerated as P, PROJECT_CONFIG_FILE_NAME as R, buildPullRequestSystemPrompt as S, findPullRequest as T, DEFAULT_MAX_DIFF_TOKENS as U, PR_BODY_PROMPTS as V, getCommitDiff as W, loadPullRequestContext as _, verifyReleaseCommits as a, submitPullRequest as b, getBranchHeadSha as c, releaseExists as d, buildCompareContext as f, getCurrentBranch as g, formatCompareSummary as h, resolveReleaseModel as i, prepareCommit as j, getCommitFiles as k, listReleaseCommits as l, fetchPullRequestCompare as m, getPreviousTag as n, writeReleaseNotes as o, createPullRequest$1 as p, dist_default$1 as q, publishRelease as r, getRepoRoot as s, bumpVersionTag as t, listReleases as u, parsePullRequestContent as v, fetchCompare as w, createRenderer as x, resolvePrBranches as y, loadConfig as z };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { A as mainController, B as COMMIT_STYLE_PROMPTS, D as mergePullRequest, E as getDefaultBranch, F as mergeTheme, G as getGit, H as PR_TITLE_PROMPTS, I as selectionTheme, J as dist_default, K as source_default, L as GLOBAL_CONFIG_FILE_PATH, N as runWithLoading, O as openPullRequest, P as acceptGenerated, R as PROJECT_CONFIG_FILE_NAME, S as buildPullRequestSystemPrompt, T as findPullRequest, V as PR_BODY_PROMPTS, _ as loadPullRequestContext, a as verifyReleaseCommits, c as getBranchHeadSha, d as releaseExists, g as getCurrentBranch, h as formatCompareSummary, i as resolveReleaseModel, k as getCommitFiles, l as listReleaseCommits, n as getPreviousTag, o as writeReleaseNotes, p as createPullRequest, q as dist_default$1, r as publishRelease, s as getRepoRoot, t as bumpVersionTag, u as listReleases, w as fetchCompare, x as createRenderer, y as resolvePrBranches, z as loadConfig } from "./flow-Dt1FS1vI.js";
|
|
3
3
|
import "./defineProperty-DZ5JLFN4.js";
|
|
4
4
|
import "./token-util-CV7QlXpE.js";
|
|
5
5
|
import { EventEmitter } from "node:events";
|
|
@@ -1699,7 +1699,7 @@ function useColor() {
|
|
|
1699
1699
|
if (process$1.env.FORCE_COLOR || process$1.env.CLICOLOR_FORCE !== void 0) return true;
|
|
1700
1700
|
}
|
|
1701
1701
|
new Command();
|
|
1702
|
-
var version = "1.1.
|
|
1702
|
+
var version = "1.1.10";
|
|
1703
1703
|
const CONFIG_SCHEMA_URL = "https://github.com/NazmusSayad/gityo/raw/refs/heads/schema/schema.json";
|
|
1704
1704
|
async function showConfigController() {
|
|
1705
1705
|
const projectConfigPath = path.join(process.cwd(), PROJECT_CONFIG_FILE_NAME);
|
|
@@ -1781,7 +1781,7 @@ async function mergePullRequestController(baseArg, headArg, options = {}) {
|
|
|
1781
1781
|
});
|
|
1782
1782
|
let pullRequest = await findPullRequest(cwd, branches.base, branches.head);
|
|
1783
1783
|
if (pullRequest) {
|
|
1784
|
-
console.log(
|
|
1784
|
+
console.log(formatCompareSummary(await fetchCompare(cwd, branches.base, branches.head)));
|
|
1785
1785
|
console.log(pullRequest.url);
|
|
1786
1786
|
} else pullRequest = await createPullRequest({
|
|
1787
1787
|
cwd,
|
package/dist/lib.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as generatePullRequest, D as mergePullRequest, E as getDefaultBranch, M as writeCommitMessage, S as buildPullRequestSystemPrompt, T as findPullRequest, U as DEFAULT_MAX_DIFF_TOKENS, W as getCommitDiff, _ as loadPullRequestContext, a as verifyReleaseCommits, b as submitPullRequest, c as getBranchHeadSha, d as releaseExists, f as buildCompareContext, i as resolveReleaseModel, j as prepareCommit, l as listReleaseCommits, m as fetchPullRequestCompare, n as getPreviousTag, o as writeReleaseNotes, r as publishRelease, s as getRepoRoot, t as bumpVersionTag, u as listReleases, v as parsePullRequestContent, y as resolvePrBranches, z as loadConfig } from "./flow-Dt1FS1vI.js";
|
|
2
2
|
import "./defineProperty-DZ5JLFN4.js";
|
|
3
3
|
import "./token-util-CV7QlXpE.js";
|
|
4
4
|
async function createCommitSession(options) {
|