versionary 1.6.0 → 1.6.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.
@@ -190,7 +190,8 @@ function buildPackageReleaseMetadata(cwd, plan, loadedConfig) {
190
190
  const packageContext = resolvePackageStrategyContext(loadedConfig, pkg.path, packageConfig);
191
191
  const releaseName = resolveReleaseName(cwd, pkg.path, packageConfig, packageContext.strategy, packageContext.config);
192
192
  metadataByPath[pkg.path] = {
193
- releaseName,
193
+ packageName: packageContext.strategy.readPackageName?.(cwd, packageContext.config) ??
194
+ releaseName,
194
195
  tagPrefix: normalizeReleaseNameForTag(releaseName),
195
196
  };
196
197
  }
@@ -448,7 +449,7 @@ export function prepareReleasePr(cwd = process.cwd(), options = {}) {
448
449
  const packageHighlights = readChangelogHighlights(cwd, packageChangelogPath, packageChangelogFormat);
449
450
  const packageSection = packageChangelogFormat === "r-news"
450
451
  ? renderRNewsReleaseNotes({
451
- packageName: packageMetadata.releaseName,
452
+ packageName: packageMetadata.packageName,
452
453
  nextVersion: packagePlan.nextVersion,
453
454
  commits: packagePlan.commits,
454
455
  cwd,
@@ -606,7 +607,7 @@ function materializeCandidateChanges(cwd, plan, options) {
606
607
  const packageHighlights = readChangelogHighlights(cwd, packageChangelogPath, packageChangelogFormat);
607
608
  const section = packageChangelogFormat === "r-news"
608
609
  ? renderRNewsReleaseNotes({
609
- packageName: metadata.releaseName,
610
+ packageName: metadata.packageName,
610
611
  nextVersion: packagePlan.nextVersion,
611
612
  commits: packagePlan.commits,
612
613
  cwd,
@@ -178,13 +178,13 @@ function findNearestLockfileDirectory(cwd, packageDirectory, lockfile) {
178
178
  current = parent;
179
179
  }
180
180
  }
181
- function readPyProjectFromCwd(cwd) {
182
- const target = path.join(cwd, "pyproject.toml");
181
+ function readPyProjectFromCwd(cwd, versionFile) {
182
+ const target = path.join(cwd, versionFile);
183
183
  if (!fs.existsSync(target)) {
184
184
  return null;
185
185
  }
186
186
  const content = fs.readFileSync(target, "utf8");
187
- return { parsed: parsePyProject(content, "pyproject.toml"), rawPath: target };
187
+ return { parsed: parsePyProject(content, versionFile), rawPath: target };
188
188
  }
189
189
  function packageNameFromParsed(parsed) {
190
190
  const projectName = parsed.project?.name;
@@ -312,20 +312,13 @@ export const pythonVersionStrategy = {
312
312
  }
313
313
  return written;
314
314
  },
315
- readPackageName(cwd, _config) {
316
- const found = readPyProjectFromCwd(cwd);
315
+ readPackageName(cwd, config) {
316
+ const versionFile = this.getVersionFile(config);
317
+ const found = readPyProjectFromCwd(cwd, isSourceFileMode(versionFile) ? "pyproject.toml" : versionFile);
317
318
  if (!found) {
318
319
  return null;
319
320
  }
320
- const projectName = found.parsed.project?.name;
321
- if (typeof projectName === "string" && projectName.trim().length > 0) {
322
- return projectName.trim();
323
- }
324
- const poetryName = found.parsed.toolPoetry?.name;
325
- if (typeof poetryName === "string" && poetryName.trim().length > 0) {
326
- return poetryName.trim();
327
- }
328
- return null;
321
+ return packageNameFromParsed(found.parsed);
329
322
  },
330
323
  finalizeVersionWrites(cwd, writes, _context) {
331
324
  const packageDirectories = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "versionary",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "Automatic release framework based on conventional commits and semantic versioning",
5
5
  "keywords": [
6
6
  "releasing",