@clarify-labs/cli 0.11.21 → 0.11.24

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.
@@ -863,6 +863,7 @@ function navigationSections(sections) {
863
863
  title: section.title,
864
864
  level: section.level,
865
865
  badge: section.badge,
866
+ deprecated: section.deprecated,
866
867
  tags: section.tags
867
868
  }));
868
869
  }
@@ -1942,6 +1943,7 @@ function routeToRuntimeManifestEntry(route, component, mode) {
1942
1943
  title: section.title,
1943
1944
  level: section.level,
1944
1945
  badge: section.badge,
1946
+ deprecated: section.deprecated,
1945
1947
  tags: section.tags
1946
1948
  }));
1947
1949
  return entry;
@@ -2265,7 +2267,7 @@ function createViteAdapter(engine) {
2265
2267
  }
2266
2268
  var cliPackageVersion = {
2267
2269
  name: "@clarify-labs/cli",
2268
- version: "0.11.21",
2270
+ version: "0.11.24",
2269
2271
  license: "AGPL-3.0-only",
2270
2272
  type: "module",
2271
2273
  repository: {
@@ -3240,19 +3242,21 @@ function extractOpenAPISections(spec, filterTags, operationOrder) {
3240
3242
  title,
3241
3243
  level: 2,
3242
3244
  badge: kind === "webhook" ? "WEBHOOK" : method.toUpperCase(),
3245
+ deprecated: op.deprecated === true ? true : void 0,
3243
3246
  tags
3244
3247
  },
3245
3248
  operationId: typeof op.operationId === "string" ? op.operationId : void 0
3246
3249
  });
3247
3250
  }
3248
3251
  }
3249
- if (!operationOrder?.length) return entries.map(({ section }) => section);
3250
- const orderById = new Map(operationOrder.map((operationId, index) => [operationId, index]));
3252
+ const orderById = new Map((operationOrder ?? []).map((operationId, index) => [operationId, index]));
3253
+ const fallbackOrder = operationOrder?.length ?? 0;
3251
3254
  return entries.map((entry, index) => ({
3252
- ...entry,
3255
+ section: entry.section,
3253
3256
  index,
3254
- order: entry.operationId ? orderById.get(entry.operationId) : void 0
3255
- })).sort((left, right) => (left.order ?? operationOrder.length) - (right.order ?? operationOrder.length) || left.index - right.index).map(({ section }) => section);
3257
+ deprecated: entry.section.deprecated === true ? 1 : 0,
3258
+ order: entry.operationId ? orderById.get(entry.operationId) ?? fallbackOrder : fallbackOrder
3259
+ })).sort((left, right) => left.deprecated - right.deprecated || left.order - right.order || left.index - right.index).map(({ section }) => section);
3256
3260
  }
3257
3261
  async function readOpenAPISpec(filePath, contentProcessor, projectRoot) {
3258
3262
  try {
@@ -3299,7 +3303,7 @@ function collectOpenAPIPageIntents(config) {
3299
3303
  continue;
3300
3304
  }
3301
3305
  const intent = routeIntentFromPagesItem(item);
3302
- if (intent.kind === "openapi" && (intent.path || intent.tagFilter?.length || intent.operationOrder?.length)) intents.push(intent);
3306
+ if (intent.kind === "openapi" && (intent.path || intent.tagFilter?.length || intent.operationOrder?.length || intent.title)) intents.push(intent);
3303
3307
  }
3304
3308
  }
3305
3309
  function visitPages(pages) {
@@ -3374,13 +3378,15 @@ function expandConfiguredOpenAPIRoutes(routes, config) {
3374
3378
  const sourceBasePath = openAPIPagePathFromRef(intent.ref);
3375
3379
  const targetBasePath = openAPIPagePathFromRef(intent.ref, tagFilter, intent.path);
3376
3380
  if (sourceBasePath === targetBasePath && !tagFilter?.length) {
3377
- if (!operationOrder?.length) continue;
3381
+ if (!operationOrder?.length && !intent.title) continue;
3378
3382
  for (let index = 0; index < routes.length; index++) {
3379
3383
  const route = routes[index];
3380
3384
  if (route.kind !== "openapi" || (route.basePath ?? route.path) !== sourceBasePath) continue;
3385
+ const configuredTitle = resolveLocalizedText(intent.title, route.locale ?? config.locales?.default ?? "", config.locales?.default);
3381
3386
  routes[index] = cloneOpenAPIRoute(route, { openapi: {
3382
3387
  ...route.openapi,
3383
- operationOrder: [...operationOrder]
3388
+ operationOrder: operationOrder?.length ? [...operationOrder] : route.openapi?.operationOrder,
3389
+ configuredTitle: configuredTitle ?? route.openapi?.configuredTitle
3384
3390
  } });
3385
3391
  }
3386
3392
  continue;
@@ -3391,6 +3397,7 @@ function expandConfiguredOpenAPIRoutes(routes, config) {
3391
3397
  if (existingKeys.has(key)) continue;
3392
3398
  existingKeys.add(key);
3393
3399
  const path = route.locale && config.locales ? localizedRoutePath(targetBasePath, route.locale, config.locales) : targetBasePath;
3400
+ const configuredTitle = resolveLocalizedText(intent.title, route.locale ?? config.locales?.default ?? "", config.locales?.default);
3394
3401
  additions.push(cloneOpenAPIRoute(route, {
3395
3402
  path,
3396
3403
  basePath: targetBasePath,
@@ -3398,7 +3405,8 @@ function expandConfiguredOpenAPIRoutes(routes, config) {
3398
3405
  openapi: {
3399
3406
  ...route.openapi,
3400
3407
  tagFilter: tagFilter?.length ? tagFilter : void 0,
3401
- operationOrder: operationOrder?.length ? [...operationOrder] : void 0
3408
+ operationOrder: operationOrder?.length ? [...operationOrder] : void 0,
3409
+ configuredTitle
3402
3410
  }
3403
3411
  }));
3404
3412
  }
@@ -3440,11 +3448,14 @@ function generateOpenAPISpecModule(spec) {
3440
3448
  return `export default ${JSON.stringify(spec)};`;
3441
3449
  }
3442
3450
  function generateOpenAPIPageModule(opts) {
3443
- const routeData = opts.operationOrder?.length ? { operationOrder: opts.operationOrder } : {};
3451
+ const routeData = {};
3452
+ if (opts.operationOrder?.length) routeData.operationOrder = opts.operationOrder;
3453
+ if (opts.title) routeData.title = opts.title;
3454
+ const serialized = Object.keys(routeData).length ? routeData : {};
3444
3455
  return `import { createOpenApiRouteComponent } from '@clarify-labs/renderer';
3445
3456
  import spec from ${JSON.stringify(opts.specModuleId)};
3446
3457
 
3447
- export const routeData = ${JSON.stringify(routeData)};
3458
+ export const routeData = ${JSON.stringify(serialized)};
3448
3459
 
3449
3460
  export default createOpenApiRouteComponent({ ...routeData, spec });
3450
3461
  `;
@@ -3501,7 +3512,7 @@ var OpenAPIPluginState = class {
3501
3512
  ...route.openapi,
3502
3513
  sourceSpecId
3503
3514
  };
3504
- route.meta.title = spec.info?.title ?? route.meta.title;
3515
+ route.meta.title = route.openapi?.configuredTitle ?? spec.info?.title ?? route.meta.title;
3505
3516
  route.meta.description = spec.info?.description ?? route.meta.description;
3506
3517
  route.meta.updatedAt = updatedAt;
3507
3518
  route.meta.sections = extractOpenAPISections(spec, route.openapi.tagFilter, route.openapi.operationOrder);
@@ -3540,7 +3551,8 @@ var OpenAPIPluginState = class {
3540
3551
  if (!this.specModules.has(routeSpecModuleId)) continue;
3541
3552
  modules.set(route.module.pageVirtualModuleId, generateOpenAPIPageModule({
3542
3553
  specModuleId: specVirtualModuleId(routeSpecModuleId),
3543
- operationOrder: route.openapi.operationOrder
3554
+ operationOrder: route.openapi.operationOrder,
3555
+ title: route.openapi.configuredTitle
3544
3556
  }));
3545
3557
  }
3546
3558
  return modules;
@@ -4905,4 +4917,4 @@ Object.defineProperty(exports, "searchMcpIndex", {
4905
4917
  }
4906
4918
  });
4907
4919
 
4908
- //# sourceMappingURL=engine-B_mPOpWr.cjs.map
4920
+ //# sourceMappingURL=engine-CanMaJiv.cjs.map