@solid-stack/mason 1.0.29 → 1.0.30

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/bin.js CHANGED
@@ -5542,6 +5542,24 @@ Code: ${v.code}`;
5542
5542
  }
5543
5543
  });
5544
5544
  }
5545
+ if (target.targetLayer === "domain" && !target.isTargetPort) {
5546
+ addViolation({
5547
+ feature: feat.name,
5548
+ layer,
5549
+ file,
5550
+ relativePath: relPath,
5551
+ line: stmt.line,
5552
+ category: "Cross-Feature Domain Violation",
5553
+ code: stmt.rawCode,
5554
+ ruleId: "F1_CROSS_FEATURE_DOMAIN",
5555
+ severity: "error",
5556
+ advice: `Cannot import domain entities/factories directly from foreign feature '${target.targetFeature}'. This bypasses its use cases and breaks Bounded Context encapsulation. Communicate via ports instead.`,
5557
+ fixExample: {
5558
+ bad: stmt.rawCode,
5559
+ good: `// Define a Port in ${feat.name}/domain/ and implement the cross-feature communication in ${feat.name}/infrastructure/ (which can then call ${target.targetFeature}'s Use Case).`
5560
+ }
5561
+ });
5562
+ }
5545
5563
  }
5546
5564
  if (layer === "domain") {
5547
5565
  if (target.targetLayer && ["useCases", "services", "infrastructure", "presentation"].includes(target.targetLayer)) {
@@ -5908,6 +5926,24 @@ Code: ${v.code}`;
5908
5926
  }
5909
5927
  });
5910
5928
  }
5929
+ if (target.targetLayer === "domain" && !target.isTargetPort && !target.isTargetRepo) {
5930
+ addViolation({
5931
+ feature: feat.name,
5932
+ layer,
5933
+ file,
5934
+ relativePath: relPath,
5935
+ line: stmt.line,
5936
+ category: "Presentation Layer Violation",
5937
+ code: stmt.rawCode,
5938
+ ruleId: "P5_DIRECT_DOMAIN_ENTITY",
5939
+ severity: "error",
5940
+ advice: "Presentation handlers must not directly instantiate or import domain entities/factories. They must map requests to flat DTOs and pass them to the Use Case.",
5941
+ fixExample: {
5942
+ bad: stmt.rawCode,
5943
+ good: "// Construct a DTO and pass it into the injected Use Case's execute() method."
5944
+ }
5945
+ });
5946
+ }
5911
5947
  }
5912
5948
  }
5913
5949
  }