@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/index.js CHANGED
@@ -4922,14 +4922,19 @@ function classifyTarget(specifier, sourceFileAbs, projectRoot) {
4922
4922
  resolvedRel = specifier.replace(/^[@~]\//, "src/");
4923
4923
  } else if (specifier.startsWith("@shared/")) {
4924
4924
  resolvedRel = "src/" + specifier.slice(1);
4925
+ } else if (specifier.startsWith("@/configs/") || specifier.startsWith("~/configs/") || specifier === "@/configs" || specifier === "~/configs") {
4926
+ resolvedRel = specifier.replace(/^[@~]\//, "src/");
4927
+ } else if (specifier === "@configs" || specifier.startsWith("@configs/")) {
4928
+ resolvedRel = "src/" + specifier.slice(1);
4925
4929
  } else if (specifier.startsWith("@/") || specifier.startsWith("~/")) {
4926
4930
  resolvedRel = "src/" + specifier.slice(2);
4927
- } else if (specifier.startsWith("features/") || specifier.startsWith("shared/")) {
4931
+ } else if (specifier.startsWith("features/") || specifier.startsWith("shared/") || specifier.startsWith("configs/") || specifier === "configs") {
4928
4932
  resolvedRel = specifier;
4929
4933
  }
4930
4934
  if (!resolvedRel) {
4931
4935
  return { isExternal: true, isDiFramework: false };
4932
4936
  }
4937
+ const isGlobalConfig = resolvedRel.startsWith("src/configs/") || resolvedRel === "src/configs" || resolvedRel.startsWith("configs/") || resolvedRel === "configs";
4933
4938
  const featMatch = resolvedRel.match(/(?:^|\/)(?:src\/)?features\/([^/]+)\/([^/]+)(?:\/(.*))?$/);
4934
4939
  if (featMatch && featMatch[1] && featMatch[2]) {
4935
4940
  const targetFeature = featMatch[1];
@@ -4980,7 +4985,7 @@ function classifyTarget(specifier, sourceFileAbs, projectRoot) {
4980
4985
  isSharedDomain
4981
4986
  };
4982
4987
  }
4983
- return { isExternal: true, isDiFramework: false };
4988
+ return { isExternal: true, isDiFramework: false, isGlobalConfig };
4984
4989
  }
4985
4990
  function extractImportStatements(content) {
4986
4991
  const statements = [];
@@ -5570,6 +5575,26 @@ Code: ${v.code}`;
5570
5575
  });
5571
5576
  }
5572
5577
  }
5578
+ if (target.isGlobalConfig) {
5579
+ addViolation({
5580
+ feature: feat.name,
5581
+ layer,
5582
+ file,
5583
+ relativePath: relPath,
5584
+ line: stmt.line,
5585
+ category: "Global Configuration Violation",
5586
+ code: stmt.rawCode,
5587
+ ruleId: "F2_GLOBAL_CONFIG_DEPENDENCY",
5588
+ severity: "error",
5589
+ 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.`,
5590
+ fixExample: {
5591
+ bad: stmt.rawCode,
5592
+ good: `// 1. Define I${toPascalCase(feat.name)}Config locally
5593
+ // 2. Inject it via static deps
5594
+ // 3. Import and bind global configs inside diProvider.ts`
5595
+ }
5596
+ });
5597
+ }
5573
5598
  if (layer === "domain") {
5574
5599
  if (target.targetLayer && ["useCases", "services", "infrastructure", "presentation"].includes(target.targetLayer)) {
5575
5600
  addViolation({
@@ -5625,7 +5650,7 @@ Code: ${v.code}`;
5625
5650
  }
5626
5651
  });
5627
5652
  }
5628
- if (target.isExternal && !target.isDiFramework) {
5653
+ if (target.isExternal && !target.isDiFramework && !target.isGlobalConfig) {
5629
5654
  addViolation({
5630
5655
  feature: feat.name,
5631
5656
  layer,