@aklinker1/zero-changelog 0.1.7 → 0.1.9

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.
Files changed (2) hide show
  1. package/dist/release.mjs +4 -3
  2. package/package.json +1 -1
package/dist/release.mjs CHANGED
@@ -13,7 +13,7 @@ import { serializeChangelog } from "./serialize-changelog.mjs";
13
13
  import { updateVersionFiles } from "./update-version-files.mjs";
14
14
  import { exec } from "node:child_process";
15
15
  import { readFile, writeFile } from "node:fs/promises";
16
- import { basename, resolve } from "node:path";
16
+ import { basename, join, resolve } from "node:path";
17
17
  //#region src/internal/run.ts
18
18
  /** Run a command, inheriting stdio. */
19
19
  async function run(options) {
@@ -72,7 +72,8 @@ async function release(options) {
72
72
  console.log("---");
73
73
  console.log(releaseNotes);
74
74
  console.log("---");
75
- const changelog = parseChangelog(await readFile("CHANGELOG.md", "utf8").catch((err) => {
75
+ const changelogPath = join(path, "CHANGELOG.md");
76
+ const changelog = parseChangelog(await readFile(changelogPath, "utf8").catch((err) => {
76
77
  if (err.code === "ENOENT") return "";
77
78
  throw err;
78
79
  }));
@@ -80,7 +81,7 @@ async function release(options) {
80
81
  header: `v${version}`,
81
82
  body: releaseNotes
82
83
  });
83
- await writeFile("CHANGELOG.md", serializeChangelog(changelog), "utf8");
84
+ await writeFile(changelogPath, serializeChangelog(changelog), "utf8");
84
85
  console.log("CHANGELOG.md updated");
85
86
  const commit = template(commitTemplate, {
86
87
  version,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aklinker1/zero-changelog",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Zero-dependency, conventional commit release and changelog generator with monorepo support",
5
5
  "keywords": [
6
6
  "changelog",