githublogen 0.1.8 → 0.2.1

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/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  Generate changelog for GitHub releases from [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/), powered by [changelogithub](https://github.com/antfu/changelogithub).
4
4
 
5
+ Auto Generate CHANGELOG.md from [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/), powered by [changelogen](https://github.com/unjs/changelogen).
6
+
5
7
  ## Usage
6
8
 
7
9
  In GitHub Actions:
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.6";
23
+ const version = "0.2.1";
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();
@@ -78,7 +78,7 @@ ${changelog}
78
78
  await execa.execa("git", ["config", "--global", "user.email", `"${email}"`]);
79
79
  await execa.execa("git", ["config", "--global", "user.name", `"${name}"`]);
80
80
  await execa.execa("git", ["add", "."]);
81
- await execa.execa("git", ["commit", "-m", '"docs(projects): CHANGELOG.md"'], { cwd });
81
+ await execa.execa("git", ["commit", "-m docs(projects): CHANGELOG.md"], { cwd });
82
82
  await execa.execa("git", ["push", pushUrl, `HEAD:${config.gitMainBranch}`], { cwd });
83
83
  }
84
84
  if (!await index.hasTagOnGitHub(config.to, config)) {
package/dist/cli.mjs CHANGED
@@ -14,7 +14,7 @@ import 'node:path';
14
14
  import 'node:v8';
15
15
  import 'node:util';
16
16
 
17
- const version = "0.1.6";
17
+ const version = "0.2.1";
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();
@@ -72,7 +72,7 @@ ${changelog}
72
72
  await execa("git", ["config", "--global", "user.email", `"${email}"`]);
73
73
  await execa("git", ["config", "--global", "user.name", `"${name}"`]);
74
74
  await execa("git", ["add", "."]);
75
- await execa("git", ["commit", "-m", '"docs(projects): CHANGELOG.md"'], { cwd });
75
+ await execa("git", ["commit", "-m docs(projects): CHANGELOG.md"], { cwd });
76
76
  await execa("git", ["push", pushUrl, `HEAD:${config.gitMainBranch}`], { cwd });
77
77
  }
78
78
  if (!await hasTagOnGitHub(config.to, config)) {
package/dist/index.cjs CHANGED
@@ -8084,7 +8084,7 @@ const domainToProvider = {
8084
8084
  "bitbucket.org": "bitbucket"
8085
8085
  };
8086
8086
  const providerURLRegex = /^(?:(?<user>\w+)@)?(?:(?<provider>[^/:]+):)?(?<repo>\w+\/\w+)(?:\.git)?$/;
8087
- function baseUrl$1(config) {
8087
+ function baseUrl(config) {
8088
8088
  return `https://${config.domain}/${config.repo}`;
8089
8089
  }
8090
8090
  function formatReference(ref, repo) {
@@ -8092,7 +8092,7 @@ function formatReference(ref, repo) {
8092
8092
  return ref.value;
8093
8093
  }
8094
8094
  const refSpec = providerToRefSpec[repo.provider];
8095
- return `[${ref.value}](${baseUrl$1(repo)}/${refSpec[ref.type]}/${ref.value.replace(/^#/, "")})`;
8095
+ return `[${ref.value}](${baseUrl(repo)}/${refSpec[ref.type]}/${ref.value.replace(/^#/, "")})`;
8096
8096
  }
8097
8097
  async function resolveRepoConfig(cwd) {
8098
8098
  const pkg = await readPackageJSON(cwd).catch(() => {
@@ -8228,10 +8228,7 @@ async function generateChangelog(commits, config) {
8228
8228
  const markdown = [];
8229
8229
  const breakingChanges = [];
8230
8230
  const v = config.newVersion && `v${config.newVersion}`;
8231
- markdown.push("", `## ${v || `${config.from || ""}...${config.to}`}`, "");
8232
- if (config.repo && config.from) {
8233
- markdown.push(formatCompareChanges(v, config));
8234
- }
8231
+ markdown.push("", `## ${v}`, "");
8235
8232
  const typeKeys = Object.keys(config.types);
8236
8233
  typeKeys.forEach((typeKey) => {
8237
8234
  const group = typeGroups[typeKey];
@@ -8294,13 +8291,6 @@ async function generateChangelog(commits, config) {
8294
8291
  }
8295
8292
  return convertGitmoji.convert(markdown.join("\n").trim(), true);
8296
8293
  }
8297
- function baseUrl(config) {
8298
- return `https://${config.domain}/${config.repo}`;
8299
- }
8300
- function formatCompareChanges(v, config) {
8301
- const part = config.repo.provider === "bitbucket" ? "branches/compare" : "compare";
8302
- return `[compare changes](${baseUrl(config.repo)}/${part}/${config.from}...${v || config.to})`;
8303
- }
8304
8294
  function formatCommit(commit, config) {
8305
8295
  return `- ${commit.scope ? `**${commit.scope.trim()}:** ` : ""}${commit.isBreaking ? "\u26A0\uFE0F " : ""}${upperFirst(
8306
8296
  commit.description
package/dist/index.mjs CHANGED
@@ -8074,7 +8074,7 @@ const domainToProvider = {
8074
8074
  "bitbucket.org": "bitbucket"
8075
8075
  };
8076
8076
  const providerURLRegex = /^(?:(?<user>\w+)@)?(?:(?<provider>[^/:]+):)?(?<repo>\w+\/\w+)(?:\.git)?$/;
8077
- function baseUrl$1(config) {
8077
+ function baseUrl(config) {
8078
8078
  return `https://${config.domain}/${config.repo}`;
8079
8079
  }
8080
8080
  function formatReference(ref, repo) {
@@ -8082,7 +8082,7 @@ function formatReference(ref, repo) {
8082
8082
  return ref.value;
8083
8083
  }
8084
8084
  const refSpec = providerToRefSpec[repo.provider];
8085
- return `[${ref.value}](${baseUrl$1(repo)}/${refSpec[ref.type]}/${ref.value.replace(/^#/, "")})`;
8085
+ return `[${ref.value}](${baseUrl(repo)}/${refSpec[ref.type]}/${ref.value.replace(/^#/, "")})`;
8086
8086
  }
8087
8087
  async function resolveRepoConfig(cwd) {
8088
8088
  const pkg = await readPackageJSON(cwd).catch(() => {
@@ -8218,10 +8218,7 @@ async function generateChangelog(commits, config) {
8218
8218
  const markdown = [];
8219
8219
  const breakingChanges = [];
8220
8220
  const v = config.newVersion && `v${config.newVersion}`;
8221
- markdown.push("", `## ${v || `${config.from || ""}...${config.to}`}`, "");
8222
- if (config.repo && config.from) {
8223
- markdown.push(formatCompareChanges(v, config));
8224
- }
8221
+ markdown.push("", `## ${v}`, "");
8225
8222
  const typeKeys = Object.keys(config.types);
8226
8223
  typeKeys.forEach((typeKey) => {
8227
8224
  const group = typeGroups[typeKey];
@@ -8284,13 +8281,6 @@ async function generateChangelog(commits, config) {
8284
8281
  }
8285
8282
  return convert(markdown.join("\n").trim(), true);
8286
8283
  }
8287
- function baseUrl(config) {
8288
- return `https://${config.domain}/${config.repo}`;
8289
- }
8290
- function formatCompareChanges(v, config) {
8291
- const part = config.repo.provider === "bitbucket" ? "branches/compare" : "compare";
8292
- return `[compare changes](${baseUrl(config.repo)}/${part}/${config.from}...${v || config.to})`;
8293
- }
8294
8284
  function formatCommit(commit, config) {
8295
8285
  return `- ${commit.scope ? `**${commit.scope.trim()}:** ` : ""}${commit.isBreaking ? "\u26A0\uFE0F " : ""}${upperFirst(
8296
8286
  commit.description
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "githublogen",
3
3
  "type": "module",
4
- "version": "0.1.8",
4
+ "version": "0.2.1",
5
5
  "sideEffects": false,
6
6
  "author": {
7
7
  "name": "SoybeanJS",
@@ -54,13 +54,12 @@
54
54
  "ohmyfetch": "0.4.21"
55
55
  },
56
56
  "devDependencies": {
57
- "@soybeanjs/cli": "0.2.11",
57
+ "@soybeanjs/cli": "0.4.1",
58
58
  "@types/node": "20.2.5",
59
59
  "bumpp": "9.1.0",
60
60
  "changelogen": "^0.5.3",
61
61
  "eslint": "8.41.0",
62
- "eslint-config-soybeanjs": "0.4.6",
63
- "lint-staged": "13.2.2",
62
+ "eslint-config-soybeanjs": "0.4.8",
64
63
  "simple-git-hooks": "2.8.1",
65
64
  "tsx": "^3.12.7",
66
65
  "typescript": "5.0.4",
@@ -68,11 +67,7 @@
68
67
  },
69
68
  "simple-git-hooks": {
70
69
  "commit-msg": "pnpm soy git-commit-verify",
71
- "pre-commit": "pnpm lint-staged"
72
- },
73
- "lint-staged": {
74
- "*.{js,mjs,jsx,ts,mts,tsx,json,vue,svelte}": "eslint . --fix",
75
- "*.!{js,mjs,jsx,ts,mts,tsx,json,vue,svelte}": "format"
70
+ "pre-commit": "pnpm soy lint-staged"
76
71
  },
77
72
  "scripts": {
78
73
  "build": "unbuild",
@@ -83,7 +78,7 @@
83
78
  "update-pkg": "soy update-pkg",
84
79
  "update-version": "bumpp --commit --push --tag",
85
80
  "publish-pkg": "pnpm -r publish --access public",
86
- "release": "pnpm update-version && pnpm publish-pkg",
81
+ "release": "pnpm update-version && pnpm build && pnpm publish-pkg",
87
82
  "typecheck": "tsc --noEmit"
88
83
  }
89
84
  }