@releasekit/notes 0.6.0 → 0.7.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.
@@ -644,7 +644,7 @@ var OllamaProvider = class extends BaseLLMProvider {
644
644
  constructor(config = {}) {
645
645
  super();
646
646
  this.baseURL = config.baseURL ?? process.env.OLLAMA_BASE_URL ?? "http://localhost:11434";
647
- this.model = config.model ?? LLM_DEFAULTS.models.ollama;
647
+ this.model = config.model ?? process.env.OLLAMA_MODEL ?? LLM_DEFAULTS.models.ollama;
648
648
  this.apiKey = config.apiKey ?? process.env.OLLAMA_API_KEY;
649
649
  }
650
650
  async complete(prompt, options) {
@@ -1461,6 +1461,21 @@ function renderTemplate(templatePath, context, engine) {
1461
1461
  }
1462
1462
 
1463
1463
  // src/core/pipeline.ts
1464
+ function findCompoundTagSepPos(tag) {
1465
+ let pos = tag.lastIndexOf("-");
1466
+ while (pos > 0) {
1467
+ const afterDash = pos + 1;
1468
+ if (tag.charCodeAt(afterDash) >= 48 && tag.charCodeAt(afterDash) <= 57) {
1469
+ let dots = 0;
1470
+ for (let i = afterDash; i < tag.length; i++) {
1471
+ if (tag[i] === ".") dots++;
1472
+ }
1473
+ if (dots >= 2) return pos;
1474
+ }
1475
+ pos = tag.lastIndexOf("-", pos - 1);
1476
+ }
1477
+ return -1;
1478
+ }
1464
1479
  function generateCompareUrl(repoUrl, from, to, packageName) {
1465
1480
  const isPackageSpecific = from.includes("@") && packageName && from.includes(packageName);
1466
1481
  let fromVersion;
@@ -1469,8 +1484,21 @@ function generateCompareUrl(repoUrl, from, to, packageName) {
1469
1484
  fromVersion = from;
1470
1485
  toVersion = `${packageName}@${to.startsWith("v") ? "" : "v"}${to}`;
1471
1486
  } else {
1472
- fromVersion = from.replace(/^v/, "");
1473
- toVersion = to.replace(/^v/, "");
1487
+ const toClean = to.replace(/^v/, "");
1488
+ const dashVPos = from.lastIndexOf("-v");
1489
+ if (dashVPos > 0 && from.charCodeAt(dashVPos + 2) >= 48 && from.charCodeAt(dashVPos + 2) <= 57) {
1490
+ fromVersion = from;
1491
+ toVersion = `${from.slice(0, dashVPos + 1)}v${toClean}`;
1492
+ } else {
1493
+ const sepPos = findCompoundTagSepPos(from);
1494
+ if (sepPos > 0) {
1495
+ fromVersion = from;
1496
+ toVersion = `${from.slice(0, sepPos + 1)}${toClean}`;
1497
+ } else {
1498
+ fromVersion = from.replace(/^v/, "");
1499
+ toVersion = toClean;
1500
+ }
1501
+ }
1474
1502
  }
1475
1503
  if (/gitlab\.com/i.test(repoUrl)) {
1476
1504
  return `${repoUrl}/-/compare/${fromVersion}...${toVersion}`;
@@ -1715,7 +1743,7 @@ async function runPipeline(input, config, dryRun) {
1715
1743
  if (releaseNotesConfig.templates?.path) {
1716
1744
  try {
1717
1745
  const templatePath = path7.resolve(releaseNotesConfig.templates.path);
1718
- const docCtx = createDocumentContext([ctx], void 0);
1746
+ const docCtx = { ...createDocumentContext([ctx], void 0), perPackage: true };
1719
1747
  const rendered = renderTemplate(
1720
1748
  templatePath,
1721
1749
  docCtx,
package/dist/cli.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  parseVersionOutput,
7
7
  runPipeline,
8
8
  saveAuth
9
- } from "./chunk-COAZCBI4.js";
9
+ } from "./chunk-7EM7VFXZ.js";
10
10
  import {
11
11
  EXIT_CODES,
12
12
  error,
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  processInput,
17
17
  runPipeline,
18
18
  saveAuth
19
- } from "./chunk-COAZCBI4.js";
19
+ } from "./chunk-7EM7VFXZ.js";
20
20
  import {
21
21
  aggregateToRoot,
22
22
  detectMonorepo,
package/docs/templates.md CHANGED
@@ -67,6 +67,8 @@ The outermost template (`document`) receives:
67
67
  | `project.repoUrl` | `string \| null` | Repository URL |
68
68
  | `versions` | `TemplateContext[]` | All rendered versions, newest first |
69
69
  | `unreleased` | `TemplateContext \| undefined` | Unreleased changes, if any |
70
+ | `compareUrls` | `Record<string, string> \| undefined` | Map of version → compare URL for all versions |
71
+ | `perPackage` | `boolean \| undefined` | `true` when rendered inline for a single package (e.g. GitHub release body). Use this to suppress document-level headings that are redundant when the content is embedded in a release that already shows the package name and version. |
70
72
 
71
73
  ### Version context
72
74
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@releasekit/notes",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Release notes and changelog generation with LLM-powered enhancement and flexible templating",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",