@clarify-labs/cli 0.11.14 → 0.11.16
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/core/config/config-schema.d.ts +2 -2
- package/output/{engine-CkWY8FUi.cjs → engine-Btadz58U.cjs} +5 -72
- package/output/engine-Btadz58U.cjs.map +1 -0
- package/output/{engine-Cfo7Ncux.js → engine-KIi5G_-d.js} +5 -72
- package/output/engine-KIi5G_-d.js.map +1 -0
- package/output/index.cjs +1 -1
- package/output/index.js +1 -1
- package/output/plugins/content-artifacts/artifacts.d.ts +1 -2
- package/package.json +3 -3
- package/output/engine-Cfo7Ncux.js.map +0 -1
- package/output/engine-CkWY8FUi.cjs.map +0 -1
|
@@ -1118,19 +1118,12 @@ var clarifyPagesItemSchema = z.lazy(() => z.union([
|
|
|
1118
1118
|
filter: z.object({ tags: z.array(z.string()).optional() }).strict().optional()
|
|
1119
1119
|
}).strict()
|
|
1120
1120
|
]));
|
|
1121
|
-
var
|
|
1121
|
+
var clarifyPagesGroupSchema = z.lazy(() => z.object({
|
|
1122
1122
|
group: clarifyLocalizedTextSchema,
|
|
1123
1123
|
icon: z.string().optional(),
|
|
1124
|
-
visible: z.enum([
|
|
1125
|
-
"always",
|
|
1126
|
-
"active",
|
|
1127
|
-
"never"
|
|
1128
|
-
]).optional(),
|
|
1129
|
-
searchable: z.boolean().optional(),
|
|
1130
1124
|
layout: z.enum(["documentation", "blog"]).optional(),
|
|
1131
1125
|
pages: z.array(clarifyPagesItemSchema)
|
|
1132
|
-
};
|
|
1133
|
-
var clarifyPagesGroupSchema = z.lazy(() => z.object(clarifyPagesGroupShape).strict());
|
|
1126
|
+
}).strict());
|
|
1134
1127
|
var clarifyPagesConfigSchema = z.union([z.array(clarifyPagesGroupSchema), z.literal("FileTree")]);
|
|
1135
1128
|
var clarifyTabItemSchema = z.object({
|
|
1136
1129
|
tab: clarifyLocalizedTextSchema,
|
|
@@ -1789,7 +1782,7 @@ function createViteAdapter(engine) {
|
|
|
1789
1782
|
}
|
|
1790
1783
|
var cliPackageVersion = {
|
|
1791
1784
|
name: "@clarify-labs/cli",
|
|
1792
|
-
version: "0.11.
|
|
1785
|
+
version: "0.11.16",
|
|
1793
1786
|
license: "AGPL-3.0-only",
|
|
1794
1787
|
type: "module",
|
|
1795
1788
|
repository: {
|
|
@@ -1915,49 +1908,6 @@ function readRouteArtifactContent(route) {
|
|
|
1915
1908
|
const content = readRouteContent(route);
|
|
1916
1909
|
return shouldUseUtf8Signature(route) ? withUtf8Signature(content) : content;
|
|
1917
1910
|
}
|
|
1918
|
-
function mergeOpenAPIRecord(target, source, section, filePath) {
|
|
1919
|
-
if (!source) return;
|
|
1920
|
-
for (const [key, value] of Object.entries(source)) {
|
|
1921
|
-
const existing = target[key];
|
|
1922
|
-
if (existing !== void 0 && JSON.stringify(existing) !== JSON.stringify(value)) throw new Error(`[clarify] Cannot aggregate OpenAPI specs: conflicting ${section} entry "${key}" in ${filePath}.`);
|
|
1923
|
-
target[key] = value;
|
|
1924
|
-
}
|
|
1925
|
-
}
|
|
1926
|
-
function createRootOpenAPISpec(routes, projectConfig) {
|
|
1927
|
-
const paths = {};
|
|
1928
|
-
const webhooks = {};
|
|
1929
|
-
const components = {};
|
|
1930
|
-
const tags = /* @__PURE__ */ new Map();
|
|
1931
|
-
const defaultLocale = projectConfig.locales?.default;
|
|
1932
|
-
for (const route of routes) {
|
|
1933
|
-
if (route.kind !== "openapi" || route.diagnostic || !route.source.content || defaultLocale && route.locale && route.locale !== defaultLocale) continue;
|
|
1934
|
-
const filePath = route.source.filePath;
|
|
1935
|
-
const spec = JSON.parse(route.source.content);
|
|
1936
|
-
mergeOpenAPIRecord(paths, spec.paths, "paths", filePath);
|
|
1937
|
-
mergeOpenAPIRecord(webhooks, "webhooks" in spec ? spec.webhooks : void 0, "webhooks", filePath);
|
|
1938
|
-
for (const [section, entries] of Object.entries(spec.components ?? {})) {
|
|
1939
|
-
components[section] ??= {};
|
|
1940
|
-
mergeOpenAPIRecord(components[section], entries, `components.${section}`, filePath);
|
|
1941
|
-
}
|
|
1942
|
-
for (const tag of spec.tags ?? []) {
|
|
1943
|
-
const existing = tags.get(tag.name);
|
|
1944
|
-
if (existing !== void 0 && JSON.stringify(existing) !== JSON.stringify(tag)) throw new Error(`[clarify] Cannot aggregate OpenAPI specs: conflicting tag "${tag.name}" in ${filePath}.`);
|
|
1945
|
-
tags.set(tag.name, tag);
|
|
1946
|
-
}
|
|
1947
|
-
}
|
|
1948
|
-
return {
|
|
1949
|
-
openapi: "3.1.0",
|
|
1950
|
-
info: {
|
|
1951
|
-
title: projectConfig.title,
|
|
1952
|
-
description: projectConfig.description,
|
|
1953
|
-
version: "1.0.0"
|
|
1954
|
-
},
|
|
1955
|
-
paths,
|
|
1956
|
-
...Object.keys(webhooks).length > 0 ? { webhooks } : {},
|
|
1957
|
-
...Object.keys(components).length > 0 ? { components } : {},
|
|
1958
|
-
...tags.size > 0 ? { tags: [...tags.values()] } : {}
|
|
1959
|
-
};
|
|
1960
|
-
}
|
|
1961
1911
|
function isLlmsTxtRoute(route) {
|
|
1962
1912
|
return !route.path.split("/").includes("404");
|
|
1963
1913
|
}
|
|
@@ -2057,14 +2007,6 @@ function serveContentArtifacts(req, res, projectConfig, routes) {
|
|
|
2057
2007
|
res.end(createLlmsTxtArtifact(routes, projectConfig), "utf8");
|
|
2058
2008
|
return true;
|
|
2059
2009
|
}
|
|
2060
|
-
if (contentPath === "/openapi.json" || contentPath === "/openapi.yml") {
|
|
2061
|
-
const spec = createRootOpenAPISpec(routes, projectConfig);
|
|
2062
|
-
const isJson = contentPath.endsWith(".json");
|
|
2063
|
-
res.statusCode = 200;
|
|
2064
|
-
res.setHeader("Content-Type", isJson ? "application/json; charset=utf-8" : "text/yaml; charset=utf-8");
|
|
2065
|
-
res.end(isJson ? JSON.stringify(spec, null, 2) : stringify(spec, { lineWidth: 0 }), "utf8");
|
|
2066
|
-
return true;
|
|
2067
|
-
}
|
|
2068
2010
|
if (contentPath.endsWith(".openapi.yaml")) {
|
|
2069
2011
|
const jsonPath = contentPath.replace(/\.yaml$/, ".json");
|
|
2070
2012
|
const route = routes.find((route) => route.artifacts?.contentArtifactUrl === jsonPath);
|
|
@@ -2124,14 +2066,6 @@ function createContentArtifactsPlugin() {
|
|
|
2124
2066
|
fileName: "llms.txt",
|
|
2125
2067
|
source: createLlmsTxtArtifact(ctx.routes, ctx.projectConfig)
|
|
2126
2068
|
});
|
|
2127
|
-
const rootOpenAPISpec = createRootOpenAPISpec(ctx.routes, ctx.projectConfig);
|
|
2128
|
-
assets.push({
|
|
2129
|
-
fileName: "openapi.json",
|
|
2130
|
-
source: JSON.stringify(rootOpenAPISpec, null, 2)
|
|
2131
|
-
}, {
|
|
2132
|
-
fileName: "openapi.yml",
|
|
2133
|
-
source: stringify(rootOpenAPISpec, { lineWidth: 0 })
|
|
2134
|
-
});
|
|
2135
2069
|
return assets;
|
|
2136
2070
|
}
|
|
2137
2071
|
}
|
|
@@ -4176,7 +4110,7 @@ var ClarifyEngine = class {
|
|
|
4176
4110
|
assertNoContentDiagnostics(this.routes);
|
|
4177
4111
|
const outputDir = this.runtime.outputDirectory ?? this.generateOptions.outputDirectory;
|
|
4178
4112
|
if (!outputDir) throw new Error("[clarify] outputDirectory is required before SSG runs");
|
|
4179
|
-
const ssrOutputDir =
|
|
4113
|
+
const ssrOutputDir = join(outputDir, ".ssr");
|
|
4180
4114
|
let tempEntryPath;
|
|
4181
4115
|
try {
|
|
4182
4116
|
tempEntryPath = createTempEntryFile(SSR_ENTRY_CODE);
|
|
@@ -4192,7 +4126,6 @@ var ClarifyEngine = class {
|
|
|
4192
4126
|
console.error("[clarify] SSG failed:", err);
|
|
4193
4127
|
throw err;
|
|
4194
4128
|
} finally {
|
|
4195
|
-
removeClarifyTempDir(ssrOutputDir);
|
|
4196
4129
|
if (tempEntryPath) try {
|
|
4197
4130
|
rmSync(tempEntryPath, { force: true });
|
|
4198
4131
|
} catch {}
|
|
@@ -4235,4 +4168,4 @@ function createClarifyEngine(options = {}) {
|
|
|
4235
4168
|
//#endregion
|
|
4236
4169
|
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 };
|
|
4237
4170
|
|
|
4238
|
-
//# sourceMappingURL=engine-
|
|
4171
|
+
//# sourceMappingURL=engine-KIi5G_-d.js.map
|