@majeanson/lac 3.0.4 → 3.1.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.
package/dist/index.mjs CHANGED
@@ -10313,6 +10313,20 @@ const spawnCommand = new Command("spawn").description("Spawn a child feature fro
10313
10313
  process$1.exit(1);
10314
10314
  }
10315
10315
  await writeFile(join(newFeatureDir, "feature.json"), JSON.stringify(validation.data, null, 2) + "\n", "utf-8");
10316
+ try {
10317
+ const parentRaw = await readFile(parentEntry.filePath, "utf-8");
10318
+ const parentData = JSON.parse(parentRaw);
10319
+ const lineage = parentData["lineage"] ?? {};
10320
+ const children = Array.isArray(lineage["children"]) ? [...lineage["children"]] : [];
10321
+ if (!children.includes(featureKey)) {
10322
+ children.push(featureKey);
10323
+ parentData["lineage"] = {
10324
+ ...lineage,
10325
+ children
10326
+ };
10327
+ await writeFile(parentEntry.filePath, JSON.stringify(parentData, null, 2) + "\n", "utf-8");
10328
+ }
10329
+ } catch {}
10316
10330
  process$1.stdout.write(`✓ Spawned ${featureKey} from ${parentKey} in ${newFeatureDir}\n`);
10317
10331
  });
10318
10332