@solid-stack/mason 1.0.30 → 1.0.31

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.cjs CHANGED
@@ -4942,14 +4942,19 @@ function classifyTarget(specifier, sourceFileAbs, projectRoot) {
4942
4942
  resolvedRel = specifier.replace(/^[@~]\//, "src/");
4943
4943
  } else if (specifier.startsWith("@shared/")) {
4944
4944
  resolvedRel = "src/" + specifier.slice(1);
4945
+ } else if (specifier.startsWith("@/configs/") || specifier.startsWith("~/configs/") || specifier === "@/configs" || specifier === "~/configs") {
4946
+ resolvedRel = specifier.replace(/^[@~]\//, "src/");
4947
+ } else if (specifier === "@configs" || specifier.startsWith("@configs/")) {
4948
+ resolvedRel = "src/" + specifier.slice(1);
4945
4949
  } else if (specifier.startsWith("@/") || specifier.startsWith("~/")) {
4946
4950
  resolvedRel = "src/" + specifier.slice(2);
4947
- } else if (specifier.startsWith("features/") || specifier.startsWith("shared/")) {
4951
+ } else if (specifier.startsWith("features/") || specifier.startsWith("shared/") || specifier.startsWith("configs/") || specifier === "configs") {
4948
4952
  resolvedRel = specifier;
4949
4953
  }
4950
4954
  if (!resolvedRel) {
4951
4955
  return { isExternal: true, isDiFramework: false };
4952
4956
  }
4957
+ const isGlobalConfig = resolvedRel.startsWith("src/configs/") || resolvedRel === "src/configs" || resolvedRel.startsWith("configs/") || resolvedRel === "configs";
4953
4958
  const featMatch = resolvedRel.match(/(?:^|\/)(?:src\/)?features\/([^/]+)\/([^/]+)(?:\/(.*))?$/);
4954
4959
  if (featMatch && featMatch[1] && featMatch[2]) {
4955
4960
  const targetFeature = featMatch[1];
@@ -5000,7 +5005,7 @@ function classifyTarget(specifier, sourceFileAbs, projectRoot) {
5000
5005
  isSharedDomain
5001
5006
  };
5002
5007
  }
5003
- return { isExternal: true, isDiFramework: false };
5008
+ return { isExternal: true, isDiFramework: false, isGlobalConfig };
5004
5009
  }
5005
5010
  function extractImportStatements(content) {
5006
5011
  const statements = [];
@@ -5590,6 +5595,26 @@ Code: ${v.code}`;
5590
5595
  });
5591
5596
  }
5592
5597
  }
5598
+ if (target.isGlobalConfig) {
5599
+ addViolation({
5600
+ feature: feat.name,
5601
+ layer,
5602
+ file,
5603
+ relativePath: relPath,
5604
+ line: stmt.line,
5605
+ category: "Global Configuration Violation",
5606
+ code: stmt.rawCode,
5607
+ ruleId: "F2_GLOBAL_CONFIG_DEPENDENCY",
5608
+ severity: "error",
5609
+ advice: `Feature layers (${layer}) must not depend directly on global configurations. Define a configuration interface/token within the feature (e.g., '${feat.name}/domain/I${toPascalCase(feat.name)}Config') and inject it. The feature's diProvider.ts will handle mapping the global config to this token.`,
5610
+ fixExample: {
5611
+ bad: stmt.rawCode,
5612
+ good: `// 1. Define I${toPascalCase(feat.name)}Config locally
5613
+ // 2. Inject it via static deps
5614
+ // 3. Import and bind global configs inside diProvider.ts`
5615
+ }
5616
+ });
5617
+ }
5593
5618
  if (layer === "domain") {
5594
5619
  if (target.targetLayer && ["useCases", "services", "infrastructure", "presentation"].includes(target.targetLayer)) {
5595
5620
  addViolation({
@@ -5645,7 +5670,7 @@ Code: ${v.code}`;
5645
5670
  }
5646
5671
  });
5647
5672
  }
5648
- if (target.isExternal && !target.isDiFramework) {
5673
+ if (target.isExternal && !target.isDiFramework && !target.isGlobalConfig) {
5649
5674
  addViolation({
5650
5675
  feature: feat.name,
5651
5676
  layer,