githublogen 0.1.5 → 0.1.6

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 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.5";
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:${branchMain}`], { cwd });
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, getGitMainBranchName, hasTagOnGitHub, isRepoShallow, sendRelease } from './index.mjs';
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.5";
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:${branchMain}`], { cwd });
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
@@ -8325,6 +8325,7 @@ const defaultConfig = {
8325
8325
  cwd: process.cwd(),
8326
8326
  from: "",
8327
8327
  to: "",
8328
+ gitMainBranch: "main",
8328
8329
  scopeMap: {},
8329
8330
  repo: {},
8330
8331
  types: {
package/dist/index.d.ts CHANGED
@@ -19,6 +19,7 @@ interface ChangelogConfig {
19
19
  to: string;
20
20
  newVersion?: string;
21
21
  output: string | boolean;
22
+ gitMainBranch: string;
22
23
  }
23
24
  interface GitCommitAuthor {
24
25
  name: string;
package/dist/index.mjs CHANGED
@@ -8315,6 +8315,7 @@ const defaultConfig = {
8315
8315
  cwd: process.cwd(),
8316
8316
  from: "",
8317
8317
  to: "",
8318
+ gitMainBranch: "main",
8318
8319
  scopeMap: {},
8319
8320
  repo: {},
8320
8321
  types: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "githublogen",
3
3
  "type": "module",
4
- "version": "0.1.5",
4
+ "version": "0.1.6",
5
5
  "sideEffects": false,
6
6
  "author": {
7
7
  "name": "SoybeanJS",