feat-forge 1.0.2 → 1.0.3

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.
@@ -84,6 +84,13 @@ export class BranchPortAllocation {
84
84
  this.services.push({ ...service, port: nextPort });
85
85
  return nextPort;
86
86
  }
87
+ /**
88
+ * Remove services that are not in the provided list of names
89
+ */
90
+ retainOnly(services) {
91
+ const serviceNames = new Set(services.map((s) => s.name));
92
+ this.services = this.services.filter((s) => serviceNames.has(s.name));
93
+ }
87
94
  getServices() {
88
95
  return this.services.slice();
89
96
  }
@@ -173,9 +180,12 @@ export class PortAllocator {
173
180
  * Allocate ports for all repositories in a branch at once
174
181
  */
175
182
  allocatePorts(branchName, repoServices) {
183
+ const allServices = repoServices.flatMap((r) => r.services);
176
184
  for (const repoService of repoServices) {
177
185
  this.allocateBranchServicesPorts(branchName, repoService.services);
178
186
  }
187
+ // Remove services that no longer exist in any repository
188
+ this.getAllocation(branchName)?.retainOnly(allServices);
179
189
  }
180
190
  /**
181
191
  * Get all allocations
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "feat-forge",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Feature-first CLI workflow tool for building software at scale with AI agents. Organize specs, parallelize work across repos and agents, and switch contexts without losing track.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "type": "module",