tegami 1.1.2 → 1.1.3
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/index.d.ts +1 -1
- package/dist/cli/index.js +35 -11
- package/dist/generators/simple.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/{npm-DoPhFKji.js → npm-CaBYeOeV.js} +115 -74
- package/dist/plugins/cargo.d.ts +1 -1
- package/dist/plugins/git.d.ts +1 -1
- package/dist/plugins/github.d.ts +18 -3
- package/dist/plugins/github.js +42 -32
- package/dist/plugins/gitlab.d.ts +18 -3
- package/dist/plugins/gitlab.js +44 -37
- package/dist/plugins/go.d.ts +1 -1
- package/dist/providers/npm.d.ts +1 -1
- package/dist/providers/npm.js +1 -1
- package/dist/{types-B50RK1rR.d.ts → types-DEyZ2r-2.d.ts} +34 -8
- package/dist/version-request-DlLpLLK3.js +445 -0
- package/package.json +2 -2
- package/dist/version-request-oxy16TJ1.js +0 -71
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { r as formatNpmDistTag } from "./semver-EKJ8yK5U.js";
|
|
2
|
-
import { n as execFailure } from "./error-BhMYq9iW.js";
|
|
3
|
-
import { x } from "tinyexec";
|
|
4
|
-
//#region src/utils/version-request.ts
|
|
5
|
-
async function hasGitChanges(cwd) {
|
|
6
|
-
const result = await x("git", ["status", "--porcelain"], { nodeOptions: { cwd } });
|
|
7
|
-
if (result.exitCode !== 0) throw execFailure("Failed to check git status.", result);
|
|
8
|
-
return result.stdout.trim().length > 0;
|
|
9
|
-
}
|
|
10
|
-
async function commitVersionBranchChanges(cwd, branch, title) {
|
|
11
|
-
const gitOptions = { nodeOptions: { cwd } };
|
|
12
|
-
let result = await x("git", [
|
|
13
|
-
"checkout",
|
|
14
|
-
"-B",
|
|
15
|
-
branch
|
|
16
|
-
], gitOptions);
|
|
17
|
-
if (result.exitCode !== 0) throw execFailure("Failed to create the version branch.", result);
|
|
18
|
-
result = await x("git", ["add", "-A"], gitOptions);
|
|
19
|
-
if (result.exitCode !== 0) throw execFailure("Failed to stage version changes.", result);
|
|
20
|
-
result = await x("git", [
|
|
21
|
-
"commit",
|
|
22
|
-
"-m",
|
|
23
|
-
title
|
|
24
|
-
], gitOptions);
|
|
25
|
-
if (result.exitCode !== 0) throw execFailure("Failed to commit version changes.", result);
|
|
26
|
-
result = await x("git", [
|
|
27
|
-
"push",
|
|
28
|
-
"--force",
|
|
29
|
-
"-u",
|
|
30
|
-
"origin",
|
|
31
|
-
branch
|
|
32
|
-
], gitOptions);
|
|
33
|
-
if (result.exitCode !== 0) throw execFailure("Failed to push the version branch to origin. Ensure `origin` is configured and you have push access.", result);
|
|
34
|
-
}
|
|
35
|
-
function createVersionRequestBody(draft, context, snapshots, summary) {
|
|
36
|
-
const packageLines = [];
|
|
37
|
-
const changesets = /* @__PURE__ */ new Map();
|
|
38
|
-
for (const [id, packageDraft] of draft.getPackageDrafts()) {
|
|
39
|
-
const pkg = context.graph.get(id);
|
|
40
|
-
if (!pkg) continue;
|
|
41
|
-
for (const entry of packageDraft.changelogs ?? []) {
|
|
42
|
-
const list = changesets.get(entry);
|
|
43
|
-
if (list) list.push(pkg);
|
|
44
|
-
else changesets.set(entry, [pkg]);
|
|
45
|
-
}
|
|
46
|
-
const originalVersion = snapshots.get(pkg.id);
|
|
47
|
-
if (!originalVersion || originalVersion === pkg.version) continue;
|
|
48
|
-
packageLines.push(`| \`${pkg.name}\` | \`${originalVersion}\` | \`${pkg.version}\`${formatNpmDistTag(packageDraft.npm?.distTag)} |`);
|
|
49
|
-
}
|
|
50
|
-
const changelogLines = [];
|
|
51
|
-
for (const [entry, linkedPackages] of changesets) {
|
|
52
|
-
changelogLines.push(`### ${entry.subject ?? `\`${entry.filename}\``}`, "");
|
|
53
|
-
changelogLines.push("<details>", `<summary>Show Bumped Packages (${linkedPackages.length})</summary>`, "", ...linkedPackages.map((pkg) => `- \`${pkg.id}\``), "", "</details>", "");
|
|
54
|
-
for (const section of entry.sections) {
|
|
55
|
-
changelogLines.push(`#### ${section.title}`, "");
|
|
56
|
-
if (section.content) changelogLines.push(section.content);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
const sections = [
|
|
60
|
-
"## Summary",
|
|
61
|
-
"",
|
|
62
|
-
summary,
|
|
63
|
-
""
|
|
64
|
-
];
|
|
65
|
-
if (packageLines.length > 0) sections.push("| Package | From | To |", "| --- | --- | --- |", ...packageLines);
|
|
66
|
-
if (changelogLines.length > 0) sections.push("", "## Changelogs", ...changelogLines);
|
|
67
|
-
sections.push("");
|
|
68
|
-
return sections.join("\n");
|
|
69
|
-
}
|
|
70
|
-
//#endregion
|
|
71
|
-
export { createVersionRequestBody as n, hasGitChanges as r, commitVersionBranchChanges as t };
|