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.
- package/dist/release/pr.js +4 -3
- package/dist/strategy/python.js +7 -14
- package/package.json +1 -1
package/dist/release/pr.js
CHANGED
|
@@ -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
|
-
|
|
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.
|
|
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.
|
|
610
|
+
packageName: metadata.packageName,
|
|
610
611
|
nextVersion: packagePlan.nextVersion,
|
|
611
612
|
commits: packagePlan.commits,
|
|
612
613
|
cwd,
|
package/dist/strategy/python.js
CHANGED
|
@@ -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,
|
|
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,
|
|
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,
|
|
316
|
-
const
|
|
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
|
-
|
|
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 = [
|