@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.
@@ -1033,20 +1033,31 @@ var AutoRouteLoader = class {
1033
1033
  return false;
1034
1034
  }
1035
1035
  const contractPaths = this.extractContractPaths(module);
1036
+ if (prefix) {
1037
+ const invalidPaths = contractPaths.filter((path) => !path.startsWith(prefix));
1038
+ if (invalidPaths.length > 0) {
1039
+ routeLogger2.error("Contract paths must include the package prefix", {
1040
+ file: relativePath,
1041
+ prefix,
1042
+ invalidPaths,
1043
+ hint: `Contract paths should start with "${prefix}". Example: path: "${prefix}/labels"`
1044
+ });
1045
+ return false;
1046
+ }
1047
+ }
1036
1048
  this.registerContractBasedMiddlewares(app, contractPaths, module);
1037
- const mountPath = prefix || "/";
1038
- app.route(mountPath, module.default);
1049
+ app.route("/", module.default);
1039
1050
  contractPaths.forEach((path) => {
1040
- const fullPath = prefix ? `${prefix}${path}` : path;
1041
1051
  this.routes.push({
1042
- path: fullPath,
1052
+ path,
1053
+ // Use contract path as-is (already includes prefix)
1043
1054
  file: relativePath,
1044
1055
  meta: module.meta,
1045
1056
  priority: this.calculateContractPriority(path)
1046
1057
  });
1047
1058
  if (this.debug) {
1048
1059
  const icon = path.includes("*") ? "\u2B50" : path.includes(":") ? "\u{1F538}" : "\u{1F539}";
1049
- routeLogger2.debug(`Registered route: ${fullPath}`, { icon, file: relativePath });
1060
+ routeLogger2.debug(`Registered route: ${path}`, { icon, file: relativePath });
1050
1061
  }
1051
1062
  });
1052
1063
  return true;