@qualcomm-ui/changesets-cli 1.2.1 → 2.0.0

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.
@@ -1,50 +1,21 @@
1
- //#region \0rolldown/runtime.js
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
- key = keys[i];
11
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
- get: ((k) => from[k]).bind(null, key),
13
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
- });
15
- }
16
- return to;
17
- };
18
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
- value: mod,
20
- enumerable: true
21
- }) : target, mod));
22
- //#endregion
23
- let _commander_js_extra_typings = require("@commander-js/extra-typings");
24
- let node_process = require("node:process");
25
- let node_readline_promises = require("node:readline/promises");
26
- let _actions_core = require("@actions/core");
27
- _actions_core = __toESM(_actions_core, 1);
28
- let _manypkg_get_packages = require("@manypkg/get-packages");
29
- let node_fs_promises = require("node:fs/promises");
30
- let node_path = require("node:path");
31
- let dayjs = require("dayjs");
32
- dayjs = __toESM(dayjs, 1);
33
- let dayjs_plugin_advancedFormat_js = require("dayjs/plugin/advancedFormat.js");
34
- dayjs_plugin_advancedFormat_js = __toESM(dayjs_plugin_advancedFormat_js, 1);
35
- let node_child_process = require("node:child_process");
36
- let _octokit_rest = require("@octokit/rest");
37
- let chalk = require("chalk");
38
- chalk = __toESM(chalk, 1);
39
- let node_os = require("node:os");
40
- let _changesets_read = require("@changesets/read");
41
- _changesets_read = __toESM(_changesets_read, 1);
42
- let _changesets_write = require("@changesets/write");
43
- _changesets_write = __toESM(_changesets_write, 1);
44
- let node_fs = require("node:fs");
45
- let ts_morph = require("ts-morph");
1
+ import { program } from "@commander-js/extra-typings";
2
+ import { stdin, stdout } from "node:process";
3
+ import { createInterface } from "node:readline/promises";
4
+ import * as core from "@actions/core";
5
+ import { getPackages, getPackagesSync } from "@manypkg/get-packages";
6
+ import { readFile, readdir, writeFile } from "node:fs/promises";
7
+ import { extname, isAbsolute, join, relative, resolve, sep } from "node:path";
8
+ import dayjs from "dayjs";
9
+ import advancedFormat from "dayjs/plugin/advancedFormat.js";
10
+ import { execFileSync, execSync } from "node:child_process";
11
+ import { Octokit } from "@octokit/rest";
12
+ import { tmpdir } from "node:os";
13
+ import readChangeset from "@changesets/read";
14
+ import writeChangeset from "@changesets/write";
15
+ import { existsSync, readFileSync } from "node:fs";
16
+ import { Node, Project, ts } from "ts-morph";
46
17
  //#region src/publishable-packages.ts
47
- var DEFAULT_CONFIG_LOCATION = (0, node_path.join)(".changeset", "config.json");
18
+ var DEFAULT_CONFIG_LOCATION = join(".changeset", "config.json");
48
19
  /**
49
20
  * Retrieves all packages in the monorepo that should be published.
50
21
  * Filters out packages marked as private and ignored packages.
@@ -54,8 +25,8 @@ var DEFAULT_CONFIG_LOCATION = (0, node_path.join)(".changeset", "config.json");
54
25
  * @returns Array of package objects that are eligible for publishing
55
26
  */
56
27
  async function getPublishablePackages(configPath, cwd = process.cwd()) {
57
- const { packages } = await (0, _manypkg_get_packages.getPackages)(cwd);
58
- const changesetConfig = JSON.parse(await (0, node_fs_promises.readFile)((0, node_path.resolve)(cwd, configPath ?? DEFAULT_CONFIG_LOCATION), "utf-8"));
28
+ const { packages } = await getPackages(cwd);
29
+ const changesetConfig = JSON.parse(await readFile(resolve(cwd, configPath ?? DEFAULT_CONFIG_LOCATION), "utf-8"));
59
30
  const ignoredPackages = new Set(changesetConfig.ignored ?? []);
60
31
  return packages.filter((pkg) => {
61
32
  if (ignoredPackages.has(pkg.packageJson.name)) return false;
@@ -102,26 +73,26 @@ async function checkVersions(options) {
102
73
  if (newer.length > 0) {
103
74
  console.log("The following packages will be published:");
104
75
  newer.forEach((r) => console.log(` ${r.name}: ${r.published} -> ${r.current}`));
105
- _actions_core.setOutput("should-publish", true);
76
+ core.setOutput("should-publish", true);
106
77
  } else {
107
78
  console.log("No packages need publishing.");
108
- _actions_core.setOutput("should-publish", false);
79
+ core.setOutput("should-publish", false);
109
80
  }
110
81
  }
111
82
  //#endregion
112
83
  //#region src/consolidate-changelogs.ts
113
- dayjs.default.extend(dayjs_plugin_advancedFormat_js.default);
84
+ dayjs.extend(advancedFormat);
114
85
  var DATE_FORMAT = "MMM Do, YYYY";
115
86
  function getChangedChangelogs() {
116
87
  try {
117
- return (0, node_child_process.execSync)("git diff --name-only HEAD", { encoding: "utf-8" }).trim().split("\n").filter(Boolean).filter((file) => file.endsWith("CHANGELOG.md"));
88
+ return execSync("git diff --name-only HEAD", { encoding: "utf-8" }).trim().split("\n").filter(Boolean).filter((file) => file.endsWith("CHANGELOG.md"));
118
89
  } catch {
119
90
  console.error("Failed to get changed files from git diff");
120
91
  process.exit(1);
121
92
  }
122
93
  }
123
94
  async function consolidateChangelog(changelogPath) {
124
- const lines = (await (0, node_fs_promises.readFile)(changelogPath, "utf-8")).split("\n");
95
+ const lines = (await readFile(changelogPath, "utf-8")).split("\n");
125
96
  const firstReleaseIndex = lines.findIndex((line) => line.startsWith("## "));
126
97
  if (firstReleaseIndex === -1) return;
127
98
  const secondReleaseIndex = lines.findIndex((line, i) => i > firstReleaseIndex && line.startsWith("## "));
@@ -138,10 +109,10 @@ async function consolidateChangelog(changelogPath) {
138
109
  const dateMatch = line.match(/\((\d{4}\/\d{2}\/\d{2})\)/);
139
110
  if (dateMatch) {
140
111
  versionLine = line.replace(` (${dateMatch[1]})`, "");
141
- dateLine = (0, dayjs.default)(dateMatch[1]).format(DATE_FORMAT);
112
+ dateLine = dayjs(dateMatch[1]).format(DATE_FORMAT);
142
113
  } else {
143
114
  versionLine = line;
144
- dateLine = (0, dayjs.default)().format(DATE_FORMAT);
115
+ dateLine = dayjs().format(DATE_FORMAT);
145
116
  }
146
117
  continue;
147
118
  }
@@ -165,7 +136,7 @@ async function consolidateChangelog(changelogPath) {
165
136
  output.push(...items);
166
137
  output.push("");
167
138
  }
168
- await (0, node_fs_promises.writeFile)(changelogPath, [
139
+ await writeFile(changelogPath, [
169
140
  ...before,
170
141
  ...output,
171
142
  ...after
@@ -193,7 +164,7 @@ async function consolidateChangelogs() {
193
164
  * @returns Object containing version, date, and body of the latest entry, or null if parsing fails
194
165
  */
195
166
  async function parseChangelog(path) {
196
- const lines = (await (0, node_fs_promises.readFile)(path, "utf-8")).split("\n");
167
+ const lines = (await readFile(path, "utf-8")).split("\n");
197
168
  const firstVersionIndex = lines.findIndex((l) => l.startsWith("## "));
198
169
  if (firstVersionIndex === -1) {
199
170
  console.log(` No version header found`);
@@ -214,23 +185,23 @@ async function parseChangelog(path) {
214
185
  };
215
186
  }
216
187
  function getRepoFromGitRemote() {
217
- const remoteUrl = (0, node_child_process.execSync)("git remote get-url origin").toString().trim();
188
+ const remoteUrl = execSync("git remote get-url origin").toString().trim();
218
189
  const match = remoteUrl.match(/github\.com[/:]([\w.-]+)\/([\w.-]+?)(?:\.git)?$/);
219
- if (!match) throw new Error(`Could not parse GitHub owner/repo from remote URL: ${remoteUrl}. Use --repo to specify explicitly.`);
190
+ if (!match) throw new Error(`Could not parse GitHub owner/repo from remote URL: ${remoteUrl}, use --repo to specify explicitly.`);
220
191
  return {
221
192
  owner: match[1],
222
193
  repo: match[2]
223
194
  };
224
195
  }
225
196
  async function createGitHubReleases(options) {
226
- const octokit = new _octokit_rest.Octokit({ auth: options.token });
197
+ const octokit = new Octokit({ auth: options.token });
227
198
  const repoOpts = options.repo ? {
228
199
  owner: options.repo.split("/")[0],
229
200
  repo: options.repo.split("/")[1]
230
201
  } : getRepoFromGitRemote();
231
202
  const packages = await getPublishablePackages(options.configPath);
232
203
  for (const pkg of packages) {
233
- const changelog = await parseChangelog((0, node_path.join)(pkg.dir, "CHANGELOG.md")).catch(() => null);
204
+ const changelog = await parseChangelog(join(pkg.dir, "CHANGELOG.md")).catch(() => null);
234
205
  if (!changelog) {
235
206
  console.warn("no changelog found, skipping package:", pkg.packageJson.name);
236
207
  continue;
@@ -245,10 +216,10 @@ async function createGitHubReleases(options) {
245
216
  tag
246
217
  }).catch(() => null);
247
218
  if (release) {
248
- console.log(`Release ${chalk.default.yellowBright(release.data.name)} already exists, skipping`);
219
+ console.log(`Release \x1b[93m${release.data.name}\x1b[0m already exists, skipping`);
249
220
  continue;
250
221
  }
251
- console.log(`Creating release: ${chalk.default.cyanBright(tag)}`);
222
+ console.log(`Creating release: \x1b[96m${tag}\x1b[0m`);
252
223
  await octokit.repos.createRelease({
253
224
  ...repoOpts,
254
225
  body: changelog.body,
@@ -286,7 +257,7 @@ function isDepsOnlyEntry(sections) {
286
257
  return hasOnlyChoresHeader && allDepsBullets && bulletLines.length > 0;
287
258
  }
288
259
  function getReleaseNotesPath() {
289
- return (0, node_path.join)((0, node_os.tmpdir)(), RELEASE_NOTES_FILENAME);
260
+ return join(tmpdir(), RELEASE_NOTES_FILENAME);
290
261
  }
291
262
  async function generateReleaseNotes() {
292
263
  const changedChangelogs = getChangedChangelogs();
@@ -296,7 +267,7 @@ async function generateReleaseNotes() {
296
267
  }
297
268
  const entries = [];
298
269
  for (const changelogPath of changedChangelogs) {
299
- const entry = extractLatestEntry(await (0, node_fs_promises.readFile)(changelogPath, "utf-8"), changelogPath);
270
+ const entry = extractLatestEntry(await readFile(changelogPath, "utf-8"), changelogPath);
300
271
  if (entry) entries.push(entry);
301
272
  }
302
273
  if (entries.length === 0) {
@@ -314,7 +285,7 @@ async function generateReleaseNotes() {
314
285
  }
315
286
  const markdown = lines.join("\n");
316
287
  const outPath = getReleaseNotesPath();
317
- await (0, node_fs_promises.writeFile)(outPath, markdown);
288
+ await writeFile(outPath, markdown);
318
289
  console.log(`Release notes written to ${outPath}`);
319
290
  console.log(` ${substantive.length} package(s) with changes, ${depsOnly.length} dependency-only update(s)`);
320
291
  return outPath;
@@ -421,14 +392,14 @@ function translateCommitsToConventionalCommitMessages(commits) {
421
392
  * @returns Array of file paths that changed
422
393
  */
423
394
  function getFilesChangedSince(opts) {
424
- return (0, node_child_process.execSync)(`git diff --name-only ${opts.from}~1...${opts.to}`).toString().trim().split("\n");
395
+ return execSync(`git diff --name-only ${opts.from}~1...${opts.to}`).toString().trim().split("\n");
425
396
  }
426
397
  /**
427
398
  * Gets the absolute path to the git repository root
428
399
  * @returns Absolute path to repository root
429
400
  */
430
401
  function getRepoRoot() {
431
- return (0, node_child_process.execSync)("git rev-parse --show-toplevel").toString().trim().replace(/\n|\r/g, "");
402
+ return execSync("git rev-parse --show-toplevel").toString().trim().replace(/\n|\r/g, "");
432
403
  }
433
404
  /**
434
405
  * Gets the full commit message for a given commit hash
@@ -436,7 +407,7 @@ function getRepoRoot() {
436
407
  * @returns The full commit message
437
408
  */
438
409
  function getCommitMessage(commitHash) {
439
- return (0, node_child_process.execSync)(`git log -1 --pretty=%B ${commitHash}`).toString().trim();
410
+ return execSync(`git log -1 --pretty=%B ${commitHash}`).toString().trim();
440
411
  }
441
412
  /**
442
413
  * Extracts all conventional commit messages from a multi-line commit message
@@ -496,7 +467,7 @@ function conventionalMessagesWithCommitsToChangesets(conventionalMessagesToCommi
496
467
  * @param branch - The branch name to fetch
497
468
  */
498
469
  function gitFetch(branch) {
499
- (0, node_child_process.execSync)(`git fetch origin ${branch}`);
470
+ execSync(`git fetch origin ${branch}`);
500
471
  }
501
472
  /**
502
473
  * Gets all commit hashes since a specific commit
@@ -504,7 +475,7 @@ function gitFetch(branch) {
504
475
  * @returns Array of commit hashes since the given commit
505
476
  */
506
477
  function getCommitsSinceCommit(sha) {
507
- return (0, node_child_process.execSync)(`git rev-list ${sha}..HEAD`).toString().split("\n").filter(Boolean).reverse();
478
+ return execSync(`git rev-list ${sha}..HEAD`).toString().split("\n").filter(Boolean).reverse();
508
479
  }
509
480
  /**
510
481
  * Gets all commit hashes since a reference branch or tag
@@ -513,7 +484,7 @@ function getCommitsSinceCommit(sha) {
513
484
  */
514
485
  function getCommitsSinceBranch(branch) {
515
486
  gitFetch(branch);
516
- return (0, node_child_process.execSync)(`git rev-list ${`origin/${branch}`}..HEAD`).toString().split("\n").filter(Boolean).reverse();
487
+ return execSync(`git rev-list ${`origin/${branch}`}..HEAD`).toString().split("\n").filter(Boolean).reverse();
517
488
  }
518
489
  /**
519
490
  * Compares two changesets for equality
@@ -535,20 +506,20 @@ function difference(a, b) {
535
506
  }
536
507
  //#endregion
537
508
  //#region src/main.ts
538
- var CHANGESET_CONFIG_LOCATION$1 = (0, node_path.join)(".changeset", "config.json");
509
+ var CHANGESET_CONFIG_LOCATION$1 = join(".changeset", "config.json");
539
510
  function getCommitsWithMessages(commitHashes) {
540
511
  return commitHashes.map((commitHash) => {
541
512
  return {
542
513
  commitHash,
543
- commitMessage: (0, node_child_process.execSync)(`git log -n 1 --pretty=format:%B ${commitHash}`).toString()
514
+ commitMessage: execSync(`git log -n 1 --pretty=format:%B ${commitHash}`).toString()
544
515
  };
545
516
  });
546
517
  }
547
518
  async function conventionalCommitChangeset(options, cwd = process.cwd()) {
548
519
  const configLocation = options.configPath ?? CHANGESET_CONFIG_LOCATION$1;
549
- const changesetConfig = JSON.parse((0, node_fs.readFileSync)((0, node_path.join)(cwd, configLocation)).toString());
520
+ const changesetConfig = JSON.parse(readFileSync(join(cwd, configLocation)).toString());
550
521
  const ignored = changesetConfig.ignore ?? [];
551
- const packages = (0, _manypkg_get_packages.getPackagesSync)(cwd).packages.filter((pkg) => Boolean(pkg.packageJson.version) && !ignored.includes(pkg.packageJson.name));
522
+ const packages = getPackagesSync(cwd).packages.filter((pkg) => Boolean(pkg.packageJson.version) && !ignored.includes(pkg.packageJson.name));
552
523
  const { baseBranch = "main" } = changesetConfig;
553
524
  const { commitSha, includeCommitLinks } = options;
554
525
  const changesets = conventionalMessagesWithCommitsToChangesets(translateCommitsToConventionalCommitMessages(getCommitsWithMessages(commitSha ? getCommitsSinceCommit(commitSha) : getCommitsSinceBranch(baseBranch))), {
@@ -556,9 +527,9 @@ async function conventionalCommitChangeset(options, cwd = process.cwd()) {
556
527
  includeCommitLinks,
557
528
  packages
558
529
  });
559
- const currentChangesets = await (0, _changesets_read.default)(cwd);
530
+ const currentChangesets = await readChangeset(cwd);
560
531
  const newChangesets = currentChangesets.length === 0 ? changesets : difference(changesets, currentChangesets);
561
- await Promise.all(newChangesets.map((changeset) => (0, _changesets_write.default)(changeset, cwd)));
532
+ await Promise.all(newChangesets.map((changeset) => writeChangeset(changeset, cwd)));
562
533
  }
563
534
  //#endregion
564
535
  //#region src/update-jsdoc-since-tags.ts
@@ -594,13 +565,13 @@ function formatJsDocSincePackageUpdateProgress({ name, version }) {
594
565
  return `Processing package ${name} ${version}...`;
595
566
  }
596
567
  function normalizeRelativePath(cwd, filePath) {
597
- return (0, node_path.relative)(cwd, filePath).split(node_path.sep).join("/");
568
+ return relative(cwd, filePath).split(sep).join("/");
598
569
  }
599
570
  function hasNextReleaseSinceTag(content) {
600
- const scanner = ts_morph.ts.createScanner(ts_morph.ts.ScriptTarget.Latest, false, ts_morph.ts.LanguageVariant.Standard, content);
571
+ const scanner = ts.createScanner(ts.ScriptTarget.Latest, false, ts.LanguageVariant.Standard, content);
601
572
  let token = scanner.scan();
602
- while (token !== ts_morph.ts.SyntaxKind.EndOfFileToken) {
603
- if (token === ts_morph.ts.SyntaxKind.MultiLineCommentTrivia) {
573
+ while (token !== ts.SyntaxKind.EndOfFileToken) {
574
+ if (token === ts.SyntaxKind.MultiLineCommentTrivia) {
604
575
  const text = scanner.getTokenText();
605
576
  if (text.startsWith("/**") && NEXT_RELEASE_TAG_PATTERN.test(text)) return true;
606
577
  }
@@ -609,8 +580,8 @@ function hasNextReleaseSinceTag(content) {
609
580
  return false;
610
581
  }
611
582
  function getNodeName(node) {
612
- if (ts_morph.Node.isClassDeclaration(node) || ts_morph.Node.isEnumDeclaration(node) || ts_morph.Node.isFunctionDeclaration(node) || ts_morph.Node.isInterfaceDeclaration(node) || ts_morph.Node.isMethodDeclaration(node) || ts_morph.Node.isMethodSignature(node) || ts_morph.Node.isPropertyDeclaration(node) || ts_morph.Node.isPropertySignature(node) || ts_morph.Node.isTypeAliasDeclaration(node)) return node.getName();
613
- if (ts_morph.Node.isVariableStatement(node)) return node.getDeclarationList().getDeclarations().map((declaration) => declaration.getName()).join(", ");
583
+ if (Node.isClassDeclaration(node) || Node.isEnumDeclaration(node) || Node.isFunctionDeclaration(node) || Node.isInterfaceDeclaration(node) || Node.isMethodDeclaration(node) || Node.isMethodSignature(node) || Node.isPropertyDeclaration(node) || Node.isPropertySignature(node) || Node.isTypeAliasDeclaration(node)) return node.getName();
584
+ if (Node.isVariableStatement(node)) return node.getDeclarationList().getDeclarations().map((declaration) => declaration.getName()).join(", ");
614
585
  }
615
586
  function getQualifiedEntityName(node) {
616
587
  const name = getNodeName(node);
@@ -631,13 +602,13 @@ function getVersionedPackages(packages) {
631
602
  });
632
603
  }
633
604
  function isSourceFile(filePath) {
634
- return SOURCE_EXTENSIONS.has((0, node_path.extname)(filePath)) && !TEST_FILE_PATTERN.test(filePath);
605
+ return SOURCE_EXTENSIONS.has(extname(filePath)) && !TEST_FILE_PATTERN.test(filePath);
635
606
  }
636
607
  async function getSourceFiles(dir) {
637
- const entries = (await (0, node_fs_promises.readdir)(dir, { withFileTypes: true })).sort((a, b) => a.name.localeCompare(b.name));
608
+ const entries = (await readdir(dir, { withFileTypes: true })).sort((a, b) => a.name.localeCompare(b.name));
638
609
  const files = [];
639
610
  for (const entry of entries) {
640
- const entryPath = (0, node_path.join)(dir, entry.name);
611
+ const entryPath = join(dir, entry.name);
641
612
  if (entry.isDirectory()) {
642
613
  if (!EXCLUDED_DIRECTORIES.has(entry.name)) files.push(...await getSourceFiles(entryPath));
643
614
  continue;
@@ -647,7 +618,7 @@ async function getSourceFiles(dir) {
647
618
  return files;
648
619
  }
649
620
  async function updateSourceFile(filePath, version) {
650
- const sourceFile = new ts_morph.Project({
621
+ const sourceFile = new Project({
651
622
  compilerOptions: {
652
623
  allowJs: true,
653
624
  checkJs: false
@@ -660,7 +631,7 @@ async function updateSourceFile(filePath, version) {
660
631
  }).addSourceFileAtPath(filePath);
661
632
  let tagCount = 0;
662
633
  sourceFile.forEachDescendant((node) => {
663
- if (!ts_morph.Node.isJSDocable(node)) return;
634
+ if (!Node.isJSDocable(node)) return;
664
635
  for (const jsDoc of node.getJsDocs()) for (const tag of jsDoc.getTags()) if (tag.getTagName() === "since" && tag.getCommentText()?.trim() === NEXT_RELEASE) {
665
636
  tag.set({
666
637
  tagName: "since",
@@ -674,14 +645,14 @@ async function updateSourceFile(filePath, version) {
674
645
  }
675
646
  async function findUnresolvedFiles(cwd, sourceFiles) {
676
647
  const unresolvedFiles = [];
677
- for (const filePath of sourceFiles) if (hasNextReleaseSinceTag(await (0, node_fs_promises.readFile)(filePath, "utf-8"))) unresolvedFiles.push(normalizeRelativePath(cwd, filePath));
648
+ for (const filePath of sourceFiles) if (hasNextReleaseSinceTag(await readFile(filePath, "utf-8"))) unresolvedFiles.push(normalizeRelativePath(cwd, filePath));
678
649
  return unresolvedFiles;
679
650
  }
680
651
  function collectSourceFileSinceTagLocations(cwd, sourceFile) {
681
652
  const filePath = normalizeRelativePath(cwd, sourceFile.getFilePath());
682
653
  const locations = [];
683
654
  sourceFile.forEachDescendant((node) => {
684
- if (!ts_morph.Node.isJSDocable(node)) return;
655
+ if (!Node.isJSDocable(node)) return;
685
656
  for (const jsDoc of node.getJsDocs()) for (const tag of jsDoc.getTags()) if (tag.getTagName() === "since" && tag.getCommentText()?.trim() === NEXT_RELEASE) locations.push({
686
657
  entityName: getQualifiedEntityName(node),
687
658
  filePath
@@ -690,7 +661,7 @@ function collectSourceFileSinceTagLocations(cwd, sourceFile) {
690
661
  return locations;
691
662
  }
692
663
  function createProject() {
693
- return new ts_morph.Project({
664
+ return new Project({
694
665
  compilerOptions: {
695
666
  allowJs: true,
696
667
  checkJs: false
@@ -765,19 +736,19 @@ function formatJsDocSinceCheckResult(result) {
765
736
  }
766
737
  //#endregion
767
738
  //#region src/version-bump.ts
768
- var CHANGESET_CONFIG_LOCATION = (0, node_path.join)(".changeset", "config.json");
739
+ var CHANGESET_CONFIG_LOCATION = join(".changeset", "config.json");
769
740
  function normalizePath(path) {
770
- return (0, node_path.resolve)(path);
741
+ return resolve(path);
771
742
  }
772
743
  function isWithinDirectory(parent, child) {
773
- const relativePath = (0, node_path.relative)(parent, child);
774
- return relativePath === "" || !relativePath.startsWith("..") && !(0, node_path.isAbsolute)(relativePath);
744
+ const relativePath = relative(parent, child);
745
+ return relativePath === "" || !relativePath.startsWith("..") && !isAbsolute(relativePath);
775
746
  }
776
747
  function getPackageLabel(directory) {
777
748
  return directory.replaceAll("\\", "/");
778
749
  }
779
750
  function getSelectedDirectory(cwd, directory) {
780
- return (0, node_path.resolve)(cwd, directory);
751
+ return resolve(cwd, directory);
781
752
  }
782
753
  function getSelectedDirectories({ cwd, directories, directory }) {
783
754
  return (directories && directories.length > 0 ? directories : directory ? [directory] : []).map((selectedDirectory) => ({
@@ -788,7 +759,7 @@ function getSelectedDirectories({ cwd, directories, directory }) {
788
759
  function getPackageSourceSnapshot(pkg, versionOverride) {
789
760
  return {
790
761
  ...pkg,
791
- root: (0, node_path.resolve)(pkg.root, "src"),
762
+ root: resolve(pkg.root, "src"),
792
763
  version: versionOverride ?? pkg.version
793
764
  };
794
765
  }
@@ -796,15 +767,15 @@ function getPackageSourceSnapshots(packages, versionOverride) {
796
767
  return packages.map((pkg) => getPackageSourceSnapshot(pkg, versionOverride));
797
768
  }
798
769
  function normalizeGitPath(path) {
799
- return path.split(node_path.sep).join("/");
770
+ return path.split(sep).join("/");
800
771
  }
801
772
  function getBaseBranch({ configPath = CHANGESET_CONFIG_LOCATION, cwd }) {
802
- return JSON.parse((0, node_fs.readFileSync)((0, node_path.join)(cwd, configPath), "utf-8")).baseBranch ?? "main";
773
+ return JSON.parse(readFileSync(join(cwd, configPath), "utf-8")).baseBranch ?? "main";
803
774
  }
804
775
  function getPackageVersionAtRef(pkg, diffRef, cwd) {
805
- const packageJsonPath = normalizeGitPath((0, node_path.relative)(cwd, (0, node_path.join)(pkg.root, "package.json")));
776
+ const packageJsonPath = normalizeGitPath(relative(cwd, join(pkg.root, "package.json")));
806
777
  try {
807
- const packageJson = (0, node_child_process.execFileSync)("git", ["show", `${diffRef}:${packageJsonPath}`], {
778
+ const packageJson = execFileSync("git", ["show", `${diffRef}:${packageJsonPath}`], {
808
779
  cwd,
809
780
  encoding: "utf-8"
810
781
  });
@@ -815,7 +786,7 @@ function getPackageVersionAtRef(pkg, diffRef, cwd) {
815
786
  }
816
787
  function isGitRefResolvable(diffRef, cwd) {
817
788
  try {
818
- (0, node_child_process.execFileSync)("git", [
789
+ execFileSync("git", [
819
790
  "rev-parse",
820
791
  "--verify",
821
792
  `${diffRef}^{commit}`
@@ -883,10 +854,10 @@ function selectCheckPackageSnapshots({ cwd = process.cwd(), directories, directo
883
854
  return selectCustomCheckSnapshots(selectedDirectories, packages);
884
855
  }
885
856
  function getPackageSnapshots(cwd = process.cwd()) {
886
- return (0, _manypkg_get_packages.getPackagesSync)(cwd).packages.flatMap((pkg) => {
857
+ return getPackagesSync(cwd).packages.flatMap((pkg) => {
887
858
  const { name, version } = pkg.packageJson;
888
859
  if (!name) return [];
889
- if (!(0, node_fs.existsSync)((0, node_path.join)(pkg.dir, "src"))) return [];
860
+ if (!existsSync(join(pkg.dir, "src"))) return [];
890
861
  return [{
891
862
  name,
892
863
  root: pkg.dir,
@@ -913,7 +884,7 @@ function getUpdatePackageSnapshots({ configPath, cwd = process.cwd(), diffRef, d
913
884
  version
914
885
  });
915
886
  }
916
- function bumpVersionsAndMaybeUpdateJsDocSinceTags({ exec = (command) => (0, node_child_process.execSync)(command, { stdio: "inherit" }), packageManager = "pnpm" } = {}) {
887
+ function bumpVersionsAndMaybeUpdateJsDocSinceTags({ exec = (command) => execSync(command, { stdio: "inherit" }), packageManager = "pnpm" } = {}) {
917
888
  exec(`${packageManager} changeset version`);
918
889
  }
919
890
  //#endregion
@@ -950,9 +921,9 @@ function buildSteps(options) {
950
921
  ];
951
922
  }
952
923
  async function waitForConfirmation(stepName) {
953
- const rl = (0, node_readline_promises.createInterface)({
954
- input: node_process.stdin,
955
- output: node_process.stdout
924
+ const rl = createInterface({
925
+ input: stdin,
926
+ output: stdout
956
927
  });
957
928
  try {
958
929
  return (await rl.question(`\nStep "${stepName}" completed. Continue to next step? [Y/n] `)).trim().toLowerCase() !== "n";
@@ -982,22 +953,22 @@ async function run(options) {
982
953
  }
983
954
  console.log("\nAll prep-release steps completed.");
984
955
  }
985
- _commander_js_extra_typings.program.allowUnknownOption(false);
986
- _commander_js_extra_typings.program.command("prep-release").description("Run all prep-release steps sequentially").option("--in-steps", "Pause after each step and wait for confirmation before continuing", false).option("--commit-sha <sha>", "Diff each package against the target commit instead of the repository's base branch").option("--include-commit-links", "Embed commit hashes in changeset summaries for changelog links", false).option("--package-manager <command>", "Package manager command to use for changeset version", "pnpm").option("--config <path>", "Path to the changesets config file, relative to the project root").action((options) => run(options));
987
- _commander_js_extra_typings.program.command("changeset-generate").description("Generate changesets from conventional commits").option("--commit-sha <sha>", "Diff each package against the target commit instead of the repository's base branch").option("--include-commit-links", "Embed commit hashes in changeset summaries for changelog links", false).option("--config <path>", "Path to the changesets config file, relative to the project root").action(({ config, ...options }) => conventionalCommitChangeset({
956
+ program.allowUnknownOption(false);
957
+ program.command("prep-release").description("Run all prep-release steps sequentially").option("--in-steps", "Pause after each step and wait for confirmation before continuing", false).option("--commit-sha <sha>", "Diff each package against the target commit instead of the repository's base branch").option("--include-commit-links", "Embed commit hashes in changeset summaries for changelog links", false).option("--package-manager <command>", "Package manager command to use for changeset version", "pnpm").option("--config <path>", "Path to the changesets config file, relative to the project root").action((options) => run(options));
958
+ program.command("changeset-generate").description("Generate changesets from conventional commits").option("--commit-sha <sha>", "Diff each package against the target commit instead of the repository's base branch").option("--include-commit-links", "Embed commit hashes in changeset summaries for changelog links", false).option("--config <path>", "Path to the changesets config file, relative to the project root").action(({ config, ...options }) => conventionalCommitChangeset({
988
959
  ...options,
989
960
  configPath: config
990
961
  }));
991
- _commander_js_extra_typings.program.command("consolidate-changelogs").description("Consolidate changelog formatting").action(() => consolidateChangelogs());
992
- _commander_js_extra_typings.program.command("generate-release-notes").description("Generate combined release notes").action(async () => {
962
+ program.command("consolidate-changelogs").description("Consolidate changelog formatting").action(() => consolidateChangelogs());
963
+ program.command("generate-release-notes").description("Generate combined release notes").action(async () => {
993
964
  await generateReleaseNotes();
994
965
  });
995
- _commander_js_extra_typings.program.command("check-versions").description("Check which packages have newer versions than what is published on npm").option("--config <path>", "Path to the changesets config file, relative to the project root").action((options) => checkVersions({ configPath: options.config }));
996
- _commander_js_extra_typings.program.command("check-jsdoc-since-tags").argument("[directories...]", "Directories to scan instead of package sources. If this is omitted, the `src` folder will be used by default").description("Check for JSDoc @since next-release tags without modifying files").action(async (directories) => {
966
+ program.command("check-versions").description("Check which packages have newer versions than what is published on npm").option("--config <path>", "Path to the changesets config file, relative to the project root").action((options) => checkVersions({ configPath: options.config }));
967
+ program.command("check-jsdoc-since-tags").argument("[directories...]", "Directories to scan instead of package sources. If this is omitted, the `src` folder will be used by default").description("Check for JSDoc @since next-release tags without modifying files").action(async (directories) => {
997
968
  const result = await checkJsDocSinceTags({ packages: getCheckPackageSnapshots({ directories }) });
998
969
  for (const line of formatJsDocSinceCheckResult(result)) console.log(line);
999
970
  });
1000
- _commander_js_extra_typings.program.command("update-jsdoc-since-tags").argument("[directories...]", "Directories to update instead of package sources").option("--version <version>", "Version to use instead of each containing package's current version").option("--diff-ref <git-ref>", "Git ref to compare package versions against (defaults to the changesets base branch)").description("Replace JSDoc @since next-release tags with package or explicit versions").action(async (directories, options) => {
971
+ program.command("update-jsdoc-since-tags").argument("[directories...]", "Directories to update instead of package sources").option("--version <version>", "Version to use instead of each containing package's current version").option("--diff-ref <git-ref>", "Git ref to compare package versions against (defaults to the changesets base branch)").description("Replace JSDoc @since next-release tags with package or explicit versions").action(async (directories, options) => {
1001
972
  console.log(formatJsDocSinceUpdateStartMessage());
1002
973
  const lines = formatJsDocSinceUpdateResult(await updateJsDocSinceTagsForPackages({
1003
974
  onProgress: console.log,
@@ -1013,7 +984,7 @@ _commander_js_extra_typings.program.command("update-jsdoc-since-tags").argument(
1013
984
  }
1014
985
  for (const line of lines) console.log(line);
1015
986
  });
1016
- _commander_js_extra_typings.program.command("create-github-releases").description("Create GitHub releases for published packages from changelogs").option("--token <token>", "GitHub token for authentication (falls back to TOKEN or GITHUB_TOKEN env vars)").option("--repo <owner/repo>", "GitHub repository in owner/repo format (defaults to git remote origin)").option("--config <path>", "Path to the changesets config file, relative to the project root").action((options) => {
987
+ program.command("create-github-releases").description("Create GitHub releases for published packages from changelogs").option("--token <token>", "GitHub token for authentication (falls back to TOKEN or GITHUB_TOKEN env vars)").option("--repo <owner/repo>", "GitHub repository in owner/repo format (defaults to git remote origin)").option("--config <path>", "Path to the changesets config file, relative to the project root").action((options) => {
1017
988
  const token = options.token ?? process.env.TOKEN ?? process.env.GITHUB_TOKEN;
1018
989
  if (!token) {
1019
990
  console.error("GitHub token is required. Use --token, or set TOKEN or GITHUB_TOKEN env var.");
@@ -1025,7 +996,8 @@ _commander_js_extra_typings.program.command("create-github-releases").descriptio
1025
996
  token
1026
997
  });
1027
998
  });
1028
- _commander_js_extra_typings.program.parse(process.argv);
999
+ program.parse(process.argv);
1029
1000
  //#endregion
1001
+ export {};
1030
1002
 
1031
- //# sourceMappingURL=cli.cjs.map
1003
+ //# sourceMappingURL=cli.js.map