githublogen 0.1.5 → 0.1.7
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.cjs +2 -3
- package/dist/cli.mjs +3 -4
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +1 -0
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -20,7 +20,7 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
20
20
|
|
|
21
21
|
const cac__default = /*#__PURE__*/_interopDefaultCompat(cac);
|
|
22
22
|
|
|
23
|
-
const version = "0.1.
|
|
23
|
+
const version = "0.1.6";
|
|
24
24
|
|
|
25
25
|
const cli = cac__default("githublogen");
|
|
26
26
|
cli.version(version).option("-t, --token <path>", "GitHub Token").option("--from <ref>", "From tag").option("--to <ref>", "To tag").option("--github <path>", "GitHub Repository, e.g. soybeanjs/githublogen").option("--name <name>", "Name of the release").option("--contributors", "Show contributors section").option("--prerelease", "Mark release as prerelease").option("-d, --draft", "Mark release as draft").option("--output <path>", "Output to file instead of sending to GitHub").option("--capitalize", "Should capitalize for each comment message").option("--emoji", "Use emojis in section titles", { default: true }).option("--group", "Nest commit messages under their scopes").option("--dry", "Dry run").help();
|
|
@@ -75,12 +75,11 @@ ${changelog}
|
|
|
75
75
|
}
|
|
76
76
|
await fs.promises.writeFile(config.output, changelogMD);
|
|
77
77
|
const { email = "unknow@unknow.com", name = "unknow" } = commits[0]?.author || {};
|
|
78
|
-
const branchMain = await index.getGitMainBranchName();
|
|
79
78
|
await execa.execa("git", ["config", "--global", "user.email", `"${email}"`]);
|
|
80
79
|
await execa.execa("git", ["config", "--global", "user.name", `"${name}"`]);
|
|
81
80
|
await execa.execa("git", ["add", "."]);
|
|
82
81
|
await execa.execa("git", ["commit", "-m", '"docs(projects): CHANGELOG.md"'], { cwd });
|
|
83
|
-
await execa.execa("git", ["push", pushUrl, `HEAD:${
|
|
82
|
+
await execa.execa("git", ["push", pushUrl, `HEAD:${config.gitMainBranch}`], { cwd });
|
|
84
83
|
}
|
|
85
84
|
if (!await index.hasTagOnGitHub(config.to, config)) {
|
|
86
85
|
console.error(kolorist.yellow(`Current ref "${kolorist.bold(config.to)}" is not available as tags on GitHub. Release skipped.`));
|
package/dist/cli.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { existsSync, promises } from 'node:fs';
|
|
|
3
3
|
import { dim, bold, cyan, blue, yellow, red } from 'kolorist';
|
|
4
4
|
import { execa } from 'execa';
|
|
5
5
|
import cac from 'cac';
|
|
6
|
-
import { generate, getGitPushUrl,
|
|
6
|
+
import { generate, getGitPushUrl, hasTagOnGitHub, isRepoShallow, sendRelease } from './index.mjs';
|
|
7
7
|
import 'ohmyfetch';
|
|
8
8
|
import 'convert-gitmoji';
|
|
9
9
|
import 'node:module';
|
|
@@ -14,7 +14,7 @@ import 'node:path';
|
|
|
14
14
|
import 'node:v8';
|
|
15
15
|
import 'node:util';
|
|
16
16
|
|
|
17
|
-
const version = "0.1.
|
|
17
|
+
const version = "0.1.6";
|
|
18
18
|
|
|
19
19
|
const cli = cac("githublogen");
|
|
20
20
|
cli.version(version).option("-t, --token <path>", "GitHub Token").option("--from <ref>", "From tag").option("--to <ref>", "To tag").option("--github <path>", "GitHub Repository, e.g. soybeanjs/githublogen").option("--name <name>", "Name of the release").option("--contributors", "Show contributors section").option("--prerelease", "Mark release as prerelease").option("-d, --draft", "Mark release as draft").option("--output <path>", "Output to file instead of sending to GitHub").option("--capitalize", "Should capitalize for each comment message").option("--emoji", "Use emojis in section titles", { default: true }).option("--group", "Nest commit messages under their scopes").option("--dry", "Dry run").help();
|
|
@@ -69,12 +69,11 @@ ${changelog}
|
|
|
69
69
|
}
|
|
70
70
|
await promises.writeFile(config.output, changelogMD);
|
|
71
71
|
const { email = "unknow@unknow.com", name = "unknow" } = commits[0]?.author || {};
|
|
72
|
-
const branchMain = await getGitMainBranchName();
|
|
73
72
|
await execa("git", ["config", "--global", "user.email", `"${email}"`]);
|
|
74
73
|
await execa("git", ["config", "--global", "user.name", `"${name}"`]);
|
|
75
74
|
await execa("git", ["add", "."]);
|
|
76
75
|
await execa("git", ["commit", "-m", '"docs(projects): CHANGELOG.md"'], { cwd });
|
|
77
|
-
await execa("git", ["push", pushUrl, `HEAD:${
|
|
76
|
+
await execa("git", ["push", pushUrl, `HEAD:${config.gitMainBranch}`], { cwd });
|
|
78
77
|
}
|
|
79
78
|
if (!await hasTagOnGitHub(config.to, config)) {
|
|
80
79
|
console.error(yellow(`Current ref "${bold(config.to)}" is not available as tags on GitHub. Release skipped.`));
|
package/dist/index.cjs
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED