@clarify-labs/cli 0.11.20 → 0.11.23

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-CAis1rme.cjs");
2
+ const require_engine = require("./engine-CnbBD_zS.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-BgfGFPKK.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-tpA8t5AF.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";
@@ -7,4 +7,5 @@ export declare function routeOutputFiles(outputDirectory: string, route: Content
7
7
  export declare const SSR_ENTRY_CODE = "import { renderToHTML } from '@clarify-labs/renderer/server';\nimport { routes, navigation } from 'virtual:clarify/routes/server';\nimport { config, runtime } from 'virtual:clarify/config';\nimport { openApiSpecs } from 'virtual:clarify/openapi/server';\nimport { runtimeSlots } from 'virtual:clarify/slots';\n\nexport async function render(url) {\n // Pre-resolve every slot component factory so renderToString can use\n // them synchronously (renderToString has no Suspense support).\n const entries = Object.values(runtimeSlots).flat()\n await Promise.all(entries.map(async (entry) => {\n const mod = await entry.loadComponent()\n entry._resolved = mod.default\n }))\n return renderToHTML({ config, routes, navigation, openApiSpecs, runtimeSlots, url, themeEditor: runtime.themeEditor });\n}";
8
8
  export declare function createTempEntryFile(content: string): string;
9
9
  export declare function buildSSRBundle(root: string, ssrEntry: string, ssrOutDir: string, plugins: Plugin[]): Promise<void>;
10
+ export declare function resolveSSRBundlePath(ssrOutputDir: string): string;
10
11
  export declare function renderSSGRoutes(routes: ContentRoute[], contextOrConfig: ClarifyProjectContext | ResolvedProjectConfig, outputDirectory: string, ssrBundlePath: string): Promise<void>;
@@ -863,6 +863,7 @@ function navigationSections(sections) {
863
863
  title: section.title,
864
864
  level: section.level,
865
865
  badge: section.badge,
866
+ deprecated: section.deprecated,
866
867
  tags: section.tags
867
868
  }));
868
869
  }
@@ -1942,6 +1943,7 @@ function routeToRuntimeManifestEntry(route, component, mode) {
1942
1943
  title: section.title,
1943
1944
  level: section.level,
1944
1945
  badge: section.badge,
1946
+ deprecated: section.deprecated,
1945
1947
  tags: section.tags
1946
1948
  }));
1947
1949
  return entry;
@@ -2265,7 +2267,7 @@ function createViteAdapter(engine) {
2265
2267
  }
2266
2268
  var cliPackageVersion = {
2267
2269
  name: "@clarify-labs/cli",
2268
- version: "0.11.20",
2270
+ version: "0.11.23",
2269
2271
  license: "AGPL-3.0-only",
2270
2272
  type: "module",
2271
2273
  repository: {
@@ -3240,6 +3242,7 @@ function extractOpenAPISections(spec, filterTags, operationOrder) {
3240
3242
  title,
3241
3243
  level: 2,
3242
3244
  badge: kind === "webhook" ? "WEBHOOK" : method.toUpperCase(),
3245
+ deprecated: op.deprecated === true ? true : void 0,
3243
3246
  tags
3244
3247
  },
3245
3248
  operationId: typeof op.operationId === "string" ? op.operationId : void 0
@@ -4395,6 +4398,20 @@ async function buildSSRBundle(root, ssrEntry, ssrOutDir, plugins) {
4395
4398
  }
4396
4399
  });
4397
4400
  }
4401
+ function resolveSSRBundlePath(ssrOutputDir) {
4402
+ for (const entryName of [
4403
+ "entry-server.js",
4404
+ "entry-server.mjs",
4405
+ "entry-server.cjs"
4406
+ ]) {
4407
+ const candidate = (0, node_path.join)(ssrOutputDir, entryName);
4408
+ if ((0, node_fs.existsSync)(candidate)) return candidate;
4409
+ }
4410
+ const fallback = (0, node_fs.readdirSync)(ssrOutputDir).filter((name) => name.startsWith("entry-server.")).sort((a, b) => a.localeCompare(b))[0];
4411
+ if (fallback) return (0, node_path.join)(ssrOutputDir, fallback);
4412
+ const files = (0, node_fs.readdirSync)(ssrOutputDir).sort((a, b) => a.localeCompare(b)).slice(0, 20);
4413
+ throw new Error(`[clarify] SSR entry bundle not found in "${ssrOutputDir}". Tried entry-server.js, entry-server.mjs, entry-server.cjs. Found files: ${files.length > 0 ? files.join(", ") : "(empty directory)"}`);
4414
+ }
4398
4415
  async function renderSSGRoutes(routes, contextOrConfig, outputDirectory, ssrBundlePath) {
4399
4416
  const { render } = await import((0, node_url.pathToFileURL)(ssrBundlePath).href);
4400
4417
  const template = readIndexHtml(outputDirectory);
@@ -4773,7 +4790,7 @@ var ClarifyEngine = class {
4773
4790
  ssrOutDir: ssrOutputDir,
4774
4791
  plugins: this.runtime.ssrPlugins ?? []
4775
4792
  });
4776
- const ssrBundlePath = (0, node_path.join)(ssrOutputDir, "entry-server.js");
4793
+ const ssrBundlePath = resolveSSRBundlePath(ssrOutputDir);
4777
4794
  await renderSSGRoutes(this.routes, this.runtimeContext(), outputDir, ssrBundlePath);
4778
4795
  } catch (err) {
4779
4796
  console.error("[clarify] SSG failed:", err);
@@ -4891,4 +4908,4 @@ Object.defineProperty(exports, "searchMcpIndex", {
4891
4908
  }
4892
4909
  });
4893
4910
 
4894
- //# sourceMappingURL=engine-CAis1rme.cjs.map
4911
+ //# sourceMappingURL=engine-CnbBD_zS.cjs.map