@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.
package/output/cli.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const require_engine = require("./engine-B_mPOpWr.cjs");
2
+ const require_engine = require("./engine-CanMaJiv.cjs");
3
3
  let node_path = require("node:path");
4
4
  let node_fs_promises = require("node:fs/promises");
5
5
  let node_child_process = require("node:child_process");
package/output/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as createClarifyTempDir, c as cliPackageVersion, d as createViteAdapter, i as findRouteConflicts, l as cliPackageVersionWithCaret, n as createClarifyEngine, o as deserializeSearchIndex, r as createClarifyRuntimeAliases, s as searchMcpIndex, u as printCliVersion } from "./engine-Ccma7jrA.js";
2
+ import { a as createClarifyTempDir, c as cliPackageVersion, d as createViteAdapter, i as findRouteConflicts, l as cliPackageVersionWithCaret, n as createClarifyEngine, o as deserializeSearchIndex, r as createClarifyRuntimeAliases, s as searchMcpIndex, u as printCliVersion } from "./engine-B3XJxakI.js";
3
3
  import { dirname, extname, isAbsolute, join, normalize, relative, resolve } from "node:path";
4
4
  import { lstat, mkdir, readFile, stat, writeFile } from "node:fs/promises";
5
5
  import { spawnSync } from "node:child_process";
@@ -833,6 +833,7 @@ function navigationSections(sections) {
833
833
  title: section.title,
834
834
  level: section.level,
835
835
  badge: section.badge,
836
+ deprecated: section.deprecated,
836
837
  tags: section.tags
837
838
  }));
838
839
  }
@@ -1912,6 +1913,7 @@ function routeToRuntimeManifestEntry(route, component, mode) {
1912
1913
  title: section.title,
1913
1914
  level: section.level,
1914
1915
  badge: section.badge,
1916
+ deprecated: section.deprecated,
1915
1917
  tags: section.tags
1916
1918
  }));
1917
1919
  return entry;
@@ -2235,7 +2237,7 @@ function createViteAdapter(engine) {
2235
2237
  }
2236
2238
  var cliPackageVersion = {
2237
2239
  name: "@clarify-labs/cli",
2238
- version: "0.11.21",
2240
+ version: "0.11.24",
2239
2241
  license: "AGPL-3.0-only",
2240
2242
  type: "module",
2241
2243
  repository: {
@@ -3210,19 +3212,21 @@ function extractOpenAPISections(spec, filterTags, operationOrder) {
3210
3212
  title,
3211
3213
  level: 2,
3212
3214
  badge: kind === "webhook" ? "WEBHOOK" : method.toUpperCase(),
3215
+ deprecated: op.deprecated === true ? true : void 0,
3213
3216
  tags
3214
3217
  },
3215
3218
  operationId: typeof op.operationId === "string" ? op.operationId : void 0
3216
3219
  });
3217
3220
  }
3218
3221
  }
3219
- if (!operationOrder?.length) return entries.map(({ section }) => section);
3220
- const orderById = new Map(operationOrder.map((operationId, index) => [operationId, index]));
3222
+ const orderById = new Map((operationOrder ?? []).map((operationId, index) => [operationId, index]));
3223
+ const fallbackOrder = operationOrder?.length ?? 0;
3221
3224
  return entries.map((entry, index) => ({
3222
- ...entry,
3225
+ section: entry.section,
3223
3226
  index,
3224
- order: entry.operationId ? orderById.get(entry.operationId) : void 0
3225
- })).sort((left, right) => (left.order ?? operationOrder.length) - (right.order ?? operationOrder.length) || left.index - right.index).map(({ section }) => section);
3227
+ deprecated: entry.section.deprecated === true ? 1 : 0,
3228
+ order: entry.operationId ? orderById.get(entry.operationId) ?? fallbackOrder : fallbackOrder
3229
+ })).sort((left, right) => left.deprecated - right.deprecated || left.order - right.order || left.index - right.index).map(({ section }) => section);
3226
3230
  }
3227
3231
  async function readOpenAPISpec(filePath, contentProcessor, projectRoot) {
3228
3232
  try {
@@ -3269,7 +3273,7 @@ function collectOpenAPIPageIntents(config) {
3269
3273
  continue;
3270
3274
  }
3271
3275
  const intent = routeIntentFromPagesItem(item);
3272
- if (intent.kind === "openapi" && (intent.path || intent.tagFilter?.length || intent.operationOrder?.length)) intents.push(intent);
3276
+ if (intent.kind === "openapi" && (intent.path || intent.tagFilter?.length || intent.operationOrder?.length || intent.title)) intents.push(intent);
3273
3277
  }
3274
3278
  }
3275
3279
  function visitPages(pages) {
@@ -3344,13 +3348,15 @@ function expandConfiguredOpenAPIRoutes(routes, config) {
3344
3348
  const sourceBasePath = openAPIPagePathFromRef(intent.ref);
3345
3349
  const targetBasePath = openAPIPagePathFromRef(intent.ref, tagFilter, intent.path);
3346
3350
  if (sourceBasePath === targetBasePath && !tagFilter?.length) {
3347
- if (!operationOrder?.length) continue;
3351
+ if (!operationOrder?.length && !intent.title) continue;
3348
3352
  for (let index = 0; index < routes.length; index++) {
3349
3353
  const route = routes[index];
3350
3354
  if (route.kind !== "openapi" || (route.basePath ?? route.path) !== sourceBasePath) continue;
3355
+ const configuredTitle = resolveLocalizedText(intent.title, route.locale ?? config.locales?.default ?? "", config.locales?.default);
3351
3356
  routes[index] = cloneOpenAPIRoute(route, { openapi: {
3352
3357
  ...route.openapi,
3353
- operationOrder: [...operationOrder]
3358
+ operationOrder: operationOrder?.length ? [...operationOrder] : route.openapi?.operationOrder,
3359
+ configuredTitle: configuredTitle ?? route.openapi?.configuredTitle
3354
3360
  } });
3355
3361
  }
3356
3362
  continue;
@@ -3361,6 +3367,7 @@ function expandConfiguredOpenAPIRoutes(routes, config) {
3361
3367
  if (existingKeys.has(key)) continue;
3362
3368
  existingKeys.add(key);
3363
3369
  const path = route.locale && config.locales ? localizedRoutePath(targetBasePath, route.locale, config.locales) : targetBasePath;
3370
+ const configuredTitle = resolveLocalizedText(intent.title, route.locale ?? config.locales?.default ?? "", config.locales?.default);
3364
3371
  additions.push(cloneOpenAPIRoute(route, {
3365
3372
  path,
3366
3373
  basePath: targetBasePath,
@@ -3368,7 +3375,8 @@ function expandConfiguredOpenAPIRoutes(routes, config) {
3368
3375
  openapi: {
3369
3376
  ...route.openapi,
3370
3377
  tagFilter: tagFilter?.length ? tagFilter : void 0,
3371
- operationOrder: operationOrder?.length ? [...operationOrder] : void 0
3378
+ operationOrder: operationOrder?.length ? [...operationOrder] : void 0,
3379
+ configuredTitle
3372
3380
  }
3373
3381
  }));
3374
3382
  }
@@ -3410,11 +3418,14 @@ function generateOpenAPISpecModule(spec) {
3410
3418
  return `export default ${JSON.stringify(spec)};`;
3411
3419
  }
3412
3420
  function generateOpenAPIPageModule(opts) {
3413
- const routeData = opts.operationOrder?.length ? { operationOrder: opts.operationOrder } : {};
3421
+ const routeData = {};
3422
+ if (opts.operationOrder?.length) routeData.operationOrder = opts.operationOrder;
3423
+ if (opts.title) routeData.title = opts.title;
3424
+ const serialized = Object.keys(routeData).length ? routeData : {};
3414
3425
  return `import { createOpenApiRouteComponent } from '@clarify-labs/renderer';
3415
3426
  import spec from ${JSON.stringify(opts.specModuleId)};
3416
3427
 
3417
- export const routeData = ${JSON.stringify(routeData)};
3428
+ export const routeData = ${JSON.stringify(serialized)};
3418
3429
 
3419
3430
  export default createOpenApiRouteComponent({ ...routeData, spec });
3420
3431
  `;
@@ -3471,7 +3482,7 @@ var OpenAPIPluginState = class {
3471
3482
  ...route.openapi,
3472
3483
  sourceSpecId
3473
3484
  };
3474
- route.meta.title = spec.info?.title ?? route.meta.title;
3485
+ route.meta.title = route.openapi?.configuredTitle ?? spec.info?.title ?? route.meta.title;
3475
3486
  route.meta.description = spec.info?.description ?? route.meta.description;
3476
3487
  route.meta.updatedAt = updatedAt;
3477
3488
  route.meta.sections = extractOpenAPISections(spec, route.openapi.tagFilter, route.openapi.operationOrder);
@@ -3510,7 +3521,8 @@ var OpenAPIPluginState = class {
3510
3521
  if (!this.specModules.has(routeSpecModuleId)) continue;
3511
3522
  modules.set(route.module.pageVirtualModuleId, generateOpenAPIPageModule({
3512
3523
  specModuleId: specVirtualModuleId(routeSpecModuleId),
3513
- operationOrder: route.openapi.operationOrder
3524
+ operationOrder: route.openapi.operationOrder,
3525
+ title: route.openapi.configuredTitle
3514
3526
  }));
3515
3527
  }
3516
3528
  return modules;
@@ -4804,4 +4816,4 @@ function createClarifyEngine(options = {}) {
4804
4816
  //#endregion
4805
4817
  export { createClarifyTempDir as a, cliPackageVersion as c, createViteAdapter as d, defineConfig as f, findRouteConflicts as i, cliPackageVersionWithCaret as l, createClarifyEngine as n, deserializeSearchIndex as o, createClarifyRuntimeAliases as r, searchMcpIndex as s, ClarifyEngine as t, printCliVersion as u };
4806
4818
 
4807
- //# sourceMappingURL=engine-Ccma7jrA.js.map
4819
+ //# sourceMappingURL=engine-B3XJxakI.js.map