@clarify-labs/cli 0.11.23 → 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 +1 -1
- package/output/cli.js +1 -1
- package/output/{engine-tpA8t5AF.js → engine-B3XJxakI.js} +24 -15
- package/output/engine-B3XJxakI.js.map +1 -0
- package/output/{engine-CnbBD_zS.cjs → engine-CanMaJiv.cjs} +24 -15
- package/output/engine-CanMaJiv.cjs.map +1 -0
- package/output/index.cjs +1 -1
- package/output/index.js +1 -1
- package/output/parsers/routes/routes.d.ts +2 -1
- package/output/plugins/openapi/virtual-modules.d.ts +1 -0
- package/output/types.d.ts +2 -0
- package/package.json +3 -3
- package/output/engine-CnbBD_zS.cjs.map +0 -1
- package/output/engine-tpA8t5AF.js.map +0 -1
|
@@ -2267,7 +2267,7 @@ function createViteAdapter(engine) {
|
|
|
2267
2267
|
}
|
|
2268
2268
|
var cliPackageVersion = {
|
|
2269
2269
|
name: "@clarify-labs/cli",
|
|
2270
|
-
version: "0.11.
|
|
2270
|
+
version: "0.11.24",
|
|
2271
2271
|
license: "AGPL-3.0-only",
|
|
2272
2272
|
type: "module",
|
|
2273
2273
|
repository: {
|
|
@@ -3249,13 +3249,14 @@ function extractOpenAPISections(spec, filterTags, operationOrder) {
|
|
|
3249
3249
|
});
|
|
3250
3250
|
}
|
|
3251
3251
|
}
|
|
3252
|
-
|
|
3253
|
-
const
|
|
3252
|
+
const orderById = new Map((operationOrder ?? []).map((operationId, index) => [operationId, index]));
|
|
3253
|
+
const fallbackOrder = operationOrder?.length ?? 0;
|
|
3254
3254
|
return entries.map((entry, index) => ({
|
|
3255
|
-
|
|
3255
|
+
section: entry.section,
|
|
3256
3256
|
index,
|
|
3257
|
-
|
|
3258
|
-
|
|
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);
|
|
3259
3260
|
}
|
|
3260
3261
|
async function readOpenAPISpec(filePath, contentProcessor, projectRoot) {
|
|
3261
3262
|
try {
|
|
@@ -3302,7 +3303,7 @@ function collectOpenAPIPageIntents(config) {
|
|
|
3302
3303
|
continue;
|
|
3303
3304
|
}
|
|
3304
3305
|
const intent = routeIntentFromPagesItem(item);
|
|
3305
|
-
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);
|
|
3306
3307
|
}
|
|
3307
3308
|
}
|
|
3308
3309
|
function visitPages(pages) {
|
|
@@ -3377,13 +3378,15 @@ function expandConfiguredOpenAPIRoutes(routes, config) {
|
|
|
3377
3378
|
const sourceBasePath = openAPIPagePathFromRef(intent.ref);
|
|
3378
3379
|
const targetBasePath = openAPIPagePathFromRef(intent.ref, tagFilter, intent.path);
|
|
3379
3380
|
if (sourceBasePath === targetBasePath && !tagFilter?.length) {
|
|
3380
|
-
if (!operationOrder?.length) continue;
|
|
3381
|
+
if (!operationOrder?.length && !intent.title) continue;
|
|
3381
3382
|
for (let index = 0; index < routes.length; index++) {
|
|
3382
3383
|
const route = routes[index];
|
|
3383
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);
|
|
3384
3386
|
routes[index] = cloneOpenAPIRoute(route, { openapi: {
|
|
3385
3387
|
...route.openapi,
|
|
3386
|
-
operationOrder: [...operationOrder]
|
|
3388
|
+
operationOrder: operationOrder?.length ? [...operationOrder] : route.openapi?.operationOrder,
|
|
3389
|
+
configuredTitle: configuredTitle ?? route.openapi?.configuredTitle
|
|
3387
3390
|
} });
|
|
3388
3391
|
}
|
|
3389
3392
|
continue;
|
|
@@ -3394,6 +3397,7 @@ function expandConfiguredOpenAPIRoutes(routes, config) {
|
|
|
3394
3397
|
if (existingKeys.has(key)) continue;
|
|
3395
3398
|
existingKeys.add(key);
|
|
3396
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);
|
|
3397
3401
|
additions.push(cloneOpenAPIRoute(route, {
|
|
3398
3402
|
path,
|
|
3399
3403
|
basePath: targetBasePath,
|
|
@@ -3401,7 +3405,8 @@ function expandConfiguredOpenAPIRoutes(routes, config) {
|
|
|
3401
3405
|
openapi: {
|
|
3402
3406
|
...route.openapi,
|
|
3403
3407
|
tagFilter: tagFilter?.length ? tagFilter : void 0,
|
|
3404
|
-
operationOrder: operationOrder?.length ? [...operationOrder] : void 0
|
|
3408
|
+
operationOrder: operationOrder?.length ? [...operationOrder] : void 0,
|
|
3409
|
+
configuredTitle
|
|
3405
3410
|
}
|
|
3406
3411
|
}));
|
|
3407
3412
|
}
|
|
@@ -3443,11 +3448,14 @@ function generateOpenAPISpecModule(spec) {
|
|
|
3443
3448
|
return `export default ${JSON.stringify(spec)};`;
|
|
3444
3449
|
}
|
|
3445
3450
|
function generateOpenAPIPageModule(opts) {
|
|
3446
|
-
const routeData =
|
|
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 : {};
|
|
3447
3455
|
return `import { createOpenApiRouteComponent } from '@clarify-labs/renderer';
|
|
3448
3456
|
import spec from ${JSON.stringify(opts.specModuleId)};
|
|
3449
3457
|
|
|
3450
|
-
export const routeData = ${JSON.stringify(
|
|
3458
|
+
export const routeData = ${JSON.stringify(serialized)};
|
|
3451
3459
|
|
|
3452
3460
|
export default createOpenApiRouteComponent({ ...routeData, spec });
|
|
3453
3461
|
`;
|
|
@@ -3504,7 +3512,7 @@ var OpenAPIPluginState = class {
|
|
|
3504
3512
|
...route.openapi,
|
|
3505
3513
|
sourceSpecId
|
|
3506
3514
|
};
|
|
3507
|
-
route.meta.title = spec.info?.title ?? route.meta.title;
|
|
3515
|
+
route.meta.title = route.openapi?.configuredTitle ?? spec.info?.title ?? route.meta.title;
|
|
3508
3516
|
route.meta.description = spec.info?.description ?? route.meta.description;
|
|
3509
3517
|
route.meta.updatedAt = updatedAt;
|
|
3510
3518
|
route.meta.sections = extractOpenAPISections(spec, route.openapi.tagFilter, route.openapi.operationOrder);
|
|
@@ -3543,7 +3551,8 @@ var OpenAPIPluginState = class {
|
|
|
3543
3551
|
if (!this.specModules.has(routeSpecModuleId)) continue;
|
|
3544
3552
|
modules.set(route.module.pageVirtualModuleId, generateOpenAPIPageModule({
|
|
3545
3553
|
specModuleId: specVirtualModuleId(routeSpecModuleId),
|
|
3546
|
-
operationOrder: route.openapi.operationOrder
|
|
3554
|
+
operationOrder: route.openapi.operationOrder,
|
|
3555
|
+
title: route.openapi.configuredTitle
|
|
3547
3556
|
}));
|
|
3548
3557
|
}
|
|
3549
3558
|
return modules;
|
|
@@ -4908,4 +4917,4 @@ Object.defineProperty(exports, "searchMcpIndex", {
|
|
|
4908
4917
|
}
|
|
4909
4918
|
});
|
|
4910
4919
|
|
|
4911
|
-
//# sourceMappingURL=engine-
|
|
4920
|
+
//# sourceMappingURL=engine-CanMaJiv.cjs.map
|