@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
package/output/cli.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const require_engine = require("./engine-
|
|
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-
|
|
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";
|
|
@@ -2237,7 +2237,7 @@ function createViteAdapter(engine) {
|
|
|
2237
2237
|
}
|
|
2238
2238
|
var cliPackageVersion = {
|
|
2239
2239
|
name: "@clarify-labs/cli",
|
|
2240
|
-
version: "0.11.
|
|
2240
|
+
version: "0.11.24",
|
|
2241
2241
|
license: "AGPL-3.0-only",
|
|
2242
2242
|
type: "module",
|
|
2243
2243
|
repository: {
|
|
@@ -3219,13 +3219,14 @@ function extractOpenAPISections(spec, filterTags, operationOrder) {
|
|
|
3219
3219
|
});
|
|
3220
3220
|
}
|
|
3221
3221
|
}
|
|
3222
|
-
|
|
3223
|
-
const
|
|
3222
|
+
const orderById = new Map((operationOrder ?? []).map((operationId, index) => [operationId, index]));
|
|
3223
|
+
const fallbackOrder = operationOrder?.length ?? 0;
|
|
3224
3224
|
return entries.map((entry, index) => ({
|
|
3225
|
-
|
|
3225
|
+
section: entry.section,
|
|
3226
3226
|
index,
|
|
3227
|
-
|
|
3228
|
-
|
|
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);
|
|
3229
3230
|
}
|
|
3230
3231
|
async function readOpenAPISpec(filePath, contentProcessor, projectRoot) {
|
|
3231
3232
|
try {
|
|
@@ -3272,7 +3273,7 @@ function collectOpenAPIPageIntents(config) {
|
|
|
3272
3273
|
continue;
|
|
3273
3274
|
}
|
|
3274
3275
|
const intent = routeIntentFromPagesItem(item);
|
|
3275
|
-
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);
|
|
3276
3277
|
}
|
|
3277
3278
|
}
|
|
3278
3279
|
function visitPages(pages) {
|
|
@@ -3347,13 +3348,15 @@ function expandConfiguredOpenAPIRoutes(routes, config) {
|
|
|
3347
3348
|
const sourceBasePath = openAPIPagePathFromRef(intent.ref);
|
|
3348
3349
|
const targetBasePath = openAPIPagePathFromRef(intent.ref, tagFilter, intent.path);
|
|
3349
3350
|
if (sourceBasePath === targetBasePath && !tagFilter?.length) {
|
|
3350
|
-
if (!operationOrder?.length) continue;
|
|
3351
|
+
if (!operationOrder?.length && !intent.title) continue;
|
|
3351
3352
|
for (let index = 0; index < routes.length; index++) {
|
|
3352
3353
|
const route = routes[index];
|
|
3353
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);
|
|
3354
3356
|
routes[index] = cloneOpenAPIRoute(route, { openapi: {
|
|
3355
3357
|
...route.openapi,
|
|
3356
|
-
operationOrder: [...operationOrder]
|
|
3358
|
+
operationOrder: operationOrder?.length ? [...operationOrder] : route.openapi?.operationOrder,
|
|
3359
|
+
configuredTitle: configuredTitle ?? route.openapi?.configuredTitle
|
|
3357
3360
|
} });
|
|
3358
3361
|
}
|
|
3359
3362
|
continue;
|
|
@@ -3364,6 +3367,7 @@ function expandConfiguredOpenAPIRoutes(routes, config) {
|
|
|
3364
3367
|
if (existingKeys.has(key)) continue;
|
|
3365
3368
|
existingKeys.add(key);
|
|
3366
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);
|
|
3367
3371
|
additions.push(cloneOpenAPIRoute(route, {
|
|
3368
3372
|
path,
|
|
3369
3373
|
basePath: targetBasePath,
|
|
@@ -3371,7 +3375,8 @@ function expandConfiguredOpenAPIRoutes(routes, config) {
|
|
|
3371
3375
|
openapi: {
|
|
3372
3376
|
...route.openapi,
|
|
3373
3377
|
tagFilter: tagFilter?.length ? tagFilter : void 0,
|
|
3374
|
-
operationOrder: operationOrder?.length ? [...operationOrder] : void 0
|
|
3378
|
+
operationOrder: operationOrder?.length ? [...operationOrder] : void 0,
|
|
3379
|
+
configuredTitle
|
|
3375
3380
|
}
|
|
3376
3381
|
}));
|
|
3377
3382
|
}
|
|
@@ -3413,11 +3418,14 @@ function generateOpenAPISpecModule(spec) {
|
|
|
3413
3418
|
return `export default ${JSON.stringify(spec)};`;
|
|
3414
3419
|
}
|
|
3415
3420
|
function generateOpenAPIPageModule(opts) {
|
|
3416
|
-
const routeData =
|
|
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 : {};
|
|
3417
3425
|
return `import { createOpenApiRouteComponent } from '@clarify-labs/renderer';
|
|
3418
3426
|
import spec from ${JSON.stringify(opts.specModuleId)};
|
|
3419
3427
|
|
|
3420
|
-
export const routeData = ${JSON.stringify(
|
|
3428
|
+
export const routeData = ${JSON.stringify(serialized)};
|
|
3421
3429
|
|
|
3422
3430
|
export default createOpenApiRouteComponent({ ...routeData, spec });
|
|
3423
3431
|
`;
|
|
@@ -3474,7 +3482,7 @@ var OpenAPIPluginState = class {
|
|
|
3474
3482
|
...route.openapi,
|
|
3475
3483
|
sourceSpecId
|
|
3476
3484
|
};
|
|
3477
|
-
route.meta.title = spec.info?.title ?? route.meta.title;
|
|
3485
|
+
route.meta.title = route.openapi?.configuredTitle ?? spec.info?.title ?? route.meta.title;
|
|
3478
3486
|
route.meta.description = spec.info?.description ?? route.meta.description;
|
|
3479
3487
|
route.meta.updatedAt = updatedAt;
|
|
3480
3488
|
route.meta.sections = extractOpenAPISections(spec, route.openapi.tagFilter, route.openapi.operationOrder);
|
|
@@ -3513,7 +3521,8 @@ var OpenAPIPluginState = class {
|
|
|
3513
3521
|
if (!this.specModules.has(routeSpecModuleId)) continue;
|
|
3514
3522
|
modules.set(route.module.pageVirtualModuleId, generateOpenAPIPageModule({
|
|
3515
3523
|
specModuleId: specVirtualModuleId(routeSpecModuleId),
|
|
3516
|
-
operationOrder: route.openapi.operationOrder
|
|
3524
|
+
operationOrder: route.openapi.operationOrder,
|
|
3525
|
+
title: route.openapi.configuredTitle
|
|
3517
3526
|
}));
|
|
3518
3527
|
}
|
|
3519
3528
|
return modules;
|
|
@@ -4807,4 +4816,4 @@ function createClarifyEngine(options = {}) {
|
|
|
4807
4816
|
//#endregion
|
|
4808
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 };
|
|
4809
4818
|
|
|
4810
|
-
//# sourceMappingURL=engine-
|
|
4819
|
+
//# sourceMappingURL=engine-B3XJxakI.js.map
|