@beastmode-develeap/beastmode 0.1.298 → 0.1.299

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.js CHANGED
@@ -3246,6 +3246,8 @@ function detectShape(parsed) {
3246
3246
  }
3247
3247
  function hasMissingCanonicalFields(parsed) {
3248
3248
  if (!parsed.stack) return true;
3249
+ const stack = parsed.stack;
3250
+ if (stack.detected === "unknown" && !stack.build_command) return true;
3249
3251
  if (!parsed.plugins) return true;
3250
3252
  if (!parsed.infra) return true;
3251
3253
  const deploy = parsed.deploy;
@@ -3413,6 +3415,21 @@ function readProjectRecord(projectsDir, name) {
3413
3415
  let isFlat = false;
3414
3416
  if (existsSync8(subdirPath)) {
3415
3417
  filePath = subdirPath;
3418
+ if (existsSync8(flatPath)) {
3419
+ try {
3420
+ const flatParsed = JSON.parse(readFileSync8(flatPath, "utf-8"));
3421
+ const flatStack = flatParsed.stack;
3422
+ const subdirParsed = JSON.parse(readFileSync8(filePath, "utf-8"));
3423
+ const subdirStack = subdirParsed.stack;
3424
+ if (flatStack && flatStack.detected && flatStack.detected !== "unknown" && (!subdirStack || subdirStack.detected === "unknown")) {
3425
+ subdirParsed.stack = flatStack;
3426
+ writeFileSync6(filePath, JSON.stringify(subdirParsed, null, 2) + "\n");
3427
+ console.error(`[project-record] Recovered stack from legacy ${name}.json`);
3428
+ }
3429
+ unlinkSync(flatPath);
3430
+ } catch {
3431
+ }
3432
+ }
3416
3433
  } else if (existsSync8(flatPath)) {
3417
3434
  filePath = flatPath;
3418
3435
  isFlat = true;