@releasekit/notes 0.40.0 → 0.41.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.
@@ -3,8 +3,8 @@ import {
3
3
  detectMonorepo,
4
4
  splitByPackage,
5
5
  writeMonorepoChangelogs
6
- } from "./chunk-WTOR47NP.js";
7
- import "./chunk-EWEPFCCT.js";
6
+ } from "./chunk-YO6KWOCB.js";
7
+ import "./chunk-FI3F2ND5.js";
8
8
  export {
9
9
  aggregateToRoot,
10
10
  detectMonorepo,
@@ -6,6 +6,7 @@ import * as path2 from "path";
6
6
  import { fileURLToPath } from "url";
7
7
  import chalk from "chalk";
8
8
  import { minimatch } from "minimatch";
9
+ import * as path3 from "path";
9
10
  function parseGitHubOwnerRepo(repoUrl) {
10
11
  const scpMatch = repoUrl.match(/^git@github\.com:([^/]+)\/(.+?)(?:\.git)?$/);
11
12
  if (scpMatch) return { owner: scpMatch[1], repo: scpMatch[2] };
@@ -160,10 +161,19 @@ var EXIT_CODES = {
160
161
  VERSION_ERROR: 8,
161
162
  PUBLISH_ERROR: 9
162
163
  };
164
+ function isPathWithinRoot(root, target) {
165
+ const resolvedRoot = path3.resolve(root);
166
+ const resolvedTarget = path3.resolve(target);
167
+ if (resolvedTarget === resolvedRoot) {
168
+ return true;
169
+ }
170
+ const relative2 = path3.relative(resolvedRoot, resolvedTarget);
171
+ return relative2 !== ".." && !relative2.startsWith(`..${path3.sep}`) && !path3.isAbsolute(relative2);
172
+ }
163
173
 
164
174
  // src/output/markdown.ts
165
175
  import * as fs3 from "fs";
166
- import * as path3 from "path";
176
+ import * as path4 from "path";
167
177
  var DEFAULT_FIRST_RELEASE_TEXT = "_First release of ${packageName}._";
168
178
  function firstReleaseLine(context, config) {
169
179
  if (!context.isFirstRelease || config === false) return void 0;
@@ -441,7 +451,7 @@ function writeMarkdown(outputPath, contexts, config, dryRun, options) {
441
451
  info(content);
442
452
  return;
443
453
  }
444
- const dir = path3.dirname(outputPath);
454
+ const dir = path4.dirname(outputPath);
445
455
  if (!fs3.existsSync(dir)) {
446
456
  fs3.mkdirSync(dir, { recursive: true });
447
457
  }
@@ -473,6 +483,7 @@ export {
473
483
  debug,
474
484
  ReleaseKitError,
475
485
  EXIT_CODES,
486
+ isPathWithinRoot,
476
487
  formatVersion,
477
488
  renderMarkdown,
478
489
  prependVersion,
@@ -5,7 +5,7 @@ import {
5
5
  prependVersion,
6
6
  renderMarkdown,
7
7
  success
8
- } from "./chunk-EWEPFCCT.js";
8
+ } from "./chunk-FI3F2ND5.js";
9
9
 
10
10
  // src/monorepo/aggregator.ts
11
11
  import * as fs from "fs";