versionary 0.20.0 → 0.20.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.
@@ -536,9 +536,40 @@ function readPackageNameForManifest(cwd, manifest) {
536
536
  }
537
537
  return readCargoPackageName(cargoTomlRaw, manifest);
538
538
  }
539
+ function expandWorkspaceOnlyManifests(cwd, manifestToVersion) {
540
+ const expanded = {};
541
+ for (const [manifest, version] of Object.entries(manifestToVersion)) {
542
+ const manifestPath = node_path_1.default.join(cwd, manifest);
543
+ if (!node_fs_1.default.existsSync(manifestPath)) {
544
+ expanded[manifest] = version;
545
+ continue;
546
+ }
547
+ const cargoTomlRaw = node_fs_1.default.readFileSync(manifestPath, "utf8");
548
+ const parsed = parseCargoManifest(manifest, cargoTomlRaw);
549
+ if (parsed.packageTable !== null || parsed.workspaceTable === null) {
550
+ expanded[manifest] = version;
551
+ continue;
552
+ }
553
+ const rootDir = node_path_1.default.dirname(manifestPath);
554
+ const memberManifests = resolveWorkspaceMemberManifests(rootDir, parsed.workspaceTable);
555
+ if (memberManifests.length === 0) {
556
+ expanded[manifest] = version;
557
+ continue;
558
+ }
559
+ const manifestDir = normalizeSlashPath(node_path_1.default.posix.dirname(manifest));
560
+ for (const memberManifest of memberManifests) {
561
+ const joined = manifestDir === "." || manifestDir === ""
562
+ ? memberManifest
563
+ : normalizeSlashPath(node_path_1.default.posix.join(manifestDir, memberManifest));
564
+ expanded[joined] = version;
565
+ }
566
+ }
567
+ return expanded;
568
+ }
539
569
  function applyRustWorkspaceDependencyUpdates(cwd, manifestToVersion) {
570
+ const expandedManifestToVersion = expandWorkspaceOnlyManifests(cwd, manifestToVersion);
540
571
  const versionByDependency = new Map();
541
- for (const [manifest, version] of Object.entries(manifestToVersion)) {
572
+ for (const [manifest, version] of Object.entries(expandedManifestToVersion)) {
542
573
  if (!version) {
543
574
  continue;
544
575
  }
@@ -568,8 +599,9 @@ function applyRustWorkspaceDependencyUpdates(cwd, manifestToVersion) {
568
599
  return updatedFiles;
569
600
  }
570
601
  function detectRustDependencyImpact(cwd, manifestToVersion, candidateManifests) {
602
+ const expandedManifestToVersion = expandWorkspaceOnlyManifests(cwd, manifestToVersion);
571
603
  const versionByDependency = new Map();
572
- for (const [manifest, version] of Object.entries(manifestToVersion)) {
604
+ for (const [manifest, version] of Object.entries(expandedManifestToVersion)) {
573
605
  if (!version) {
574
606
  continue;
575
607
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "versionary",
3
- "version": "0.20.0",
3
+ "version": "0.20.1",
4
4
  "description": "Automatic release framework based on conventional commits and semantic versioning",
5
5
  "keywords": [
6
6
  "releasing",