@atlashub/smartstack-cli 4.9.0 → 4.11.0

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.
@@ -26100,7 +26100,7 @@ var init_types3 = __esm({
26100
26100
  includeLayouts: external_exports.boolean().default(true).describe("Generate layout components"),
26101
26101
  includeGuards: external_exports.boolean().default(true).describe("Include route guards for permissions"),
26102
26102
  generateRegistry: external_exports.boolean().default(true).describe("Generate navRoutes.generated.ts"),
26103
- outputFormat: external_exports.enum(["standalone", "clientRoutes"]).default("standalone").describe('Output format: "standalone" generates createBrowserRouter(), "clientRoutes" generates exportable RouteObject[] arrays for App.tsx integration'),
26103
+ outputFormat: external_exports.enum(["standalone", "applicationRoutes", "clientRoutes"]).default("standalone").describe('Output format: "standalone" generates createBrowserRouter(), "applicationRoutes" generates exportable RouteObject[] arrays for App.tsx integration (note: "clientRoutes" is a deprecated alias for "applicationRoutes")'),
26104
26104
  dryRun: external_exports.boolean().default(false).describe("Preview without writing files")
26105
26105
  }).optional()
26106
26106
  });
@@ -27955,15 +27955,15 @@ async function validateFrontendRoutes(structure, _config, result) {
27955
27955
  return;
27956
27956
  }
27957
27957
  const appContent = await readText(appFiles[0]);
27958
- const hasClientRoutes = appContent.includes("clientRoutes");
27958
+ const hasApplicationRoutes = appContent.includes("applicationRoutes") || appContent.includes("clientRoutes");
27959
27959
  const hasRouteComponents = /<Route\s/.test(appContent);
27960
- if (!hasClientRoutes && !hasRouteComponents) {
27960
+ if (!hasApplicationRoutes && !hasRouteComponents) {
27961
27961
  result.errors.push({
27962
27962
  type: "error",
27963
27963
  category: "frontend-routes",
27964
- message: "App.tsx has no route definitions (neither clientRoutes import nor <Route> components)",
27964
+ message: "App.tsx has no route definitions (neither applicationRoutes import nor <Route> components)",
27965
27965
  file: path8.relative(structure.root, appFiles[0]),
27966
- suggestion: "Wire generated routes to App.tsx. Import clientRoutes from the generated file and render them."
27966
+ suggestion: "Wire generated routes to App.tsx. Import applicationRouteExtensions from the generated file and render them."
27967
27967
  });
27968
27968
  return;
27969
27969
  }
@@ -57808,17 +57808,17 @@ async function scaffoldRoutes(input, config2) {
57808
57808
  result.files.push({ path: registryFile, content: registryContent, type: "created" });
57809
57809
  }
57810
57810
  const outputFormat = options?.outputFormat ?? "standalone";
57811
- if (outputFormat === "clientRoutes") {
57811
+ if (outputFormat === "applicationRoutes" || outputFormat === "clientRoutes") {
57812
57812
  const pageFiles = await discoverPageFiles(webPath, navRoutes);
57813
- const clientRoutesContent = generateClientRoutesConfig(navRoutes, pageFiles, includeGuards);
57814
- const clientRoutesFile = path19.join(routesPath, "clientRoutes.generated.tsx");
57813
+ const applicationRoutesContent = generateApplicationRoutesConfig(navRoutes, pageFiles, includeGuards);
57814
+ const applicationRoutesFile = path19.join(routesPath, "applicationRoutes.generated.tsx");
57815
57815
  if (!dryRun) {
57816
57816
  await ensureDirectory(routesPath);
57817
- await writeText(clientRoutesFile, clientRoutesContent);
57817
+ await writeText(applicationRoutesFile, applicationRoutesContent);
57818
57818
  }
57819
- result.files.push({ path: clientRoutesFile, content: clientRoutesContent, type: "created" });
57819
+ result.files.push({ path: applicationRoutesFile, content: applicationRoutesContent, type: "created" });
57820
57820
  const routeCount = navRoutes.length * 4;
57821
- result.instructions.push(`Generated ${routeCount} routes (4 CRUD per NavRoute) for ${navRoutes.length} NavRoutes in clientRoutes format`);
57821
+ result.instructions.push(`Generated ${routeCount} routes (4 CRUD per NavRoute) for ${navRoutes.length} NavRoutes in applicationRoutes format`);
57822
57822
  result.instructions.push("");
57823
57823
  result.instructions.push("## App.tsx Wiring Instructions");
57824
57824
  result.instructions.push("");
@@ -58382,14 +58382,14 @@ async function discoverPageFiles(webPath, routes) {
58382
58382
  }
58383
58383
  return pageMap;
58384
58384
  }
58385
- function generateClientRoutesConfig(routes, pageFiles, includeGuards) {
58385
+ function generateApplicationRoutesConfig(routes, pageFiles, includeGuards) {
58386
58386
  const routeTree = buildRouteTree(routes);
58387
58387
  const lines = [
58388
58388
  "/**",
58389
- " * Client Routes Configuration",
58389
+ " * Application Routes Configuration",
58390
58390
  " *",
58391
58391
  " * Auto-generated by SmartStack MCP - DO NOT EDIT MANUALLY",
58392
- ' * Run `scaffold_routes` with outputFormat: "clientRoutes" to regenerate.',
58392
+ ' * Run `scaffold_routes` with outputFormat: "applicationRoutes" to regenerate.',
58393
58393
  " *",
58394
58394
  " * These routes are FLAT (not nested children) \u2014 compatible with mergeRoutes().",
58395
58395
  " * Each NavRoute generates up to 4 CRUD routes: list, create, detail, edit.",
@@ -58523,7 +58523,7 @@ function generateClientRoutesConfig(routes, pageFiles, includeGuards) {
58523
58523
  lines.push(" * Import and spread into your App.tsx applicationRoutes:");
58524
58524
  lines.push(" *");
58525
58525
  lines.push(" * ```tsx");
58526
- lines.push(" * import { applicationRouteExtensions } from './routes/clientRoutes.generated';");
58526
+ lines.push(" * import { applicationRouteExtensions } from './routes/applicationRoutes.generated';");
58527
58527
  lines.push(" * const applicationRoutes = {");
58528
58528
  lines.push(" * ...applicationRouteExtensions,");
58529
58529
  lines.push(" * // your additional routes...");
@@ -58647,7 +58647,7 @@ and generates corresponding frontend routing infrastructure.`,
58647
58647
  includeLayouts: { type: "boolean", default: true },
58648
58648
  includeGuards: { type: "boolean", default: true },
58649
58649
  generateRegistry: { type: "boolean", default: true },
58650
- outputFormat: { type: "string", enum: ["standalone", "clientRoutes"], default: "standalone", description: "standalone: createBrowserRouter(), clientRoutes: RouteObject[] arrays for App.tsx" },
58650
+ outputFormat: { type: "string", enum: ["standalone", "applicationRoutes", "clientRoutes"], default: "standalone", description: "standalone: createBrowserRouter(), applicationRoutes: RouteObject[] arrays for App.tsx (clientRoutes is a deprecated alias)" },
58651
58651
  dryRun: { type: "boolean", default: false }
58652
58652
  }
58653
58653
  }
@@ -58838,7 +58838,7 @@ async function validateApiClients(webPath, backendRoutes, result) {
58838
58838
  }
58839
58839
  }
58840
58840
  async function validateRoutes(webPath, backendRoutes, result) {
58841
- const routeCandidates = ["clientRoutes.generated.tsx", "index.tsx"];
58841
+ const routeCandidates = ["applicationRoutes.generated.tsx", "clientRoutes.generated.tsx", "index.tsx"];
58842
58842
  let routesContent = "";
58843
58843
  for (const candidate of routeCandidates) {
58844
58844
  const candidatePath = path20.join(webPath, "src", "routes", candidate);
@@ -58938,10 +58938,10 @@ async function validateAppWiring(webPath, backendRoutes, result) {
58938
58938
  );
58939
58939
  return;
58940
58940
  }
58941
- const hasClientRoutesImport = appContent.includes("clientRoutes.generated");
58941
+ const hasApplicationRoutesImport = appContent.includes("applicationRoutes.generated") || appContent.includes("clientRoutes.generated");
58942
58942
  const hasRoutesImport = appContent.includes("from './routes") || appContent.includes("from '../routes");
58943
58943
  const hasInlineRoutes = appContent.includes("<Route ");
58944
- result.appWiring.routesImported = hasClientRoutesImport || hasRoutesImport || hasInlineRoutes;
58944
+ result.appWiring.routesImported = hasApplicationRoutesImport || hasRoutesImport || hasInlineRoutes;
58945
58945
  if (!result.appWiring.routesImported) {
58946
58946
  result.appWiring.issues.push("App.tsx does not import any route configuration");
58947
58947
  return;