@spfn/core 0.1.0-alpha.65 → 0.1.0-alpha.68

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.
@@ -2772,20 +2772,31 @@ var AutoRouteLoader = class {
2772
2772
  return false;
2773
2773
  }
2774
2774
  const contractPaths = this.extractContractPaths(module);
2775
+ if (prefix) {
2776
+ const invalidPaths = contractPaths.filter((path) => !path.startsWith(prefix));
2777
+ if (invalidPaths.length > 0) {
2778
+ routeLogger2.error("Contract paths must include the package prefix", {
2779
+ file: relativePath,
2780
+ prefix,
2781
+ invalidPaths,
2782
+ hint: `Contract paths should start with "${prefix}". Example: path: "${prefix}/labels"`
2783
+ });
2784
+ return false;
2785
+ }
2786
+ }
2775
2787
  this.registerContractBasedMiddlewares(app, contractPaths, module);
2776
- const mountPath = prefix || "/";
2777
- app.route(mountPath, module.default);
2788
+ app.route("/", module.default);
2778
2789
  contractPaths.forEach((path) => {
2779
- const fullPath = prefix ? `${prefix}${path}` : path;
2780
2790
  this.routes.push({
2781
- path: fullPath,
2791
+ path,
2792
+ // Use contract path as-is (already includes prefix)
2782
2793
  file: relativePath,
2783
2794
  meta: module.meta,
2784
2795
  priority: this.calculateContractPriority(path)
2785
2796
  });
2786
2797
  if (this.debug) {
2787
2798
  const icon = path.includes("*") ? "\u2B50" : path.includes(":") ? "\u{1F538}" : "\u{1F539}";
2788
- routeLogger2.debug(`Registered route: ${fullPath}`, { icon, file: relativePath });
2799
+ routeLogger2.debug(`Registered route: ${path}`, { icon, file: relativePath });
2789
2800
  }
2790
2801
  });
2791
2802
  return true;