@clarify-labs/cli 0.11.15 → 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.
@@ -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 clarifyPagesGroupShape = {
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.15",
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,8 +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 resolvedOutputDir = resolve(this.root, outputDir);
4180
- const ssrOutputDir = createClarifyTempDir("ssr-output");
4113
+ const ssrOutputDir = join(outputDir, ".ssr");
4181
4114
  let tempEntryPath;
4182
4115
  try {
4183
4116
  tempEntryPath = createTempEntryFile(SSR_ENTRY_CODE);
@@ -4188,12 +4121,11 @@ var ClarifyEngine = class {
4188
4121
  plugins: this.runtime.ssrPlugins ?? []
4189
4122
  });
4190
4123
  const ssrBundlePath = join(ssrOutputDir, "entry-server.js");
4191
- await renderSSGRoutes(this.routes, this.runtimeContext(), resolvedOutputDir, ssrBundlePath);
4124
+ await renderSSGRoutes(this.routes, this.runtimeContext(), outputDir, ssrBundlePath);
4192
4125
  } catch (err) {
4193
4126
  console.error("[clarify] SSG failed:", err);
4194
4127
  throw err;
4195
4128
  } finally {
4196
- removeClarifyTempDir(ssrOutputDir);
4197
4129
  if (tempEntryPath) try {
4198
4130
  rmSync(tempEntryPath, { force: true });
4199
4131
  } catch {}
@@ -4236,4 +4168,4 @@ function createClarifyEngine(options = {}) {
4236
4168
  //#endregion
4237
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 };
4238
4170
 
4239
- //# sourceMappingURL=engine-DMfwsN-k.js.map
4171
+ //# sourceMappingURL=engine-KIi5G_-d.js.map