@clarify-labs/cli 0.11.20 → 0.11.21

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.
@@ -2235,7 +2235,7 @@ function createViteAdapter(engine) {
2235
2235
  }
2236
2236
  var cliPackageVersion = {
2237
2237
  name: "@clarify-labs/cli",
2238
- version: "0.11.20",
2238
+ version: "0.11.21",
2239
2239
  license: "AGPL-3.0-only",
2240
2240
  type: "module",
2241
2241
  repository: {
@@ -4365,6 +4365,20 @@ async function buildSSRBundle(root, ssrEntry, ssrOutDir, plugins) {
4365
4365
  }
4366
4366
  });
4367
4367
  }
4368
+ function resolveSSRBundlePath(ssrOutputDir) {
4369
+ for (const entryName of [
4370
+ "entry-server.js",
4371
+ "entry-server.mjs",
4372
+ "entry-server.cjs"
4373
+ ]) {
4374
+ const candidate = join(ssrOutputDir, entryName);
4375
+ if (existsSync(candidate)) return candidate;
4376
+ }
4377
+ const fallback = readdirSync(ssrOutputDir).filter((name) => name.startsWith("entry-server.")).sort((a, b) => a.localeCompare(b))[0];
4378
+ if (fallback) return join(ssrOutputDir, fallback);
4379
+ const files = readdirSync(ssrOutputDir).sort((a, b) => a.localeCompare(b)).slice(0, 20);
4380
+ 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)"}`);
4381
+ }
4368
4382
  async function renderSSGRoutes(routes, contextOrConfig, outputDirectory, ssrBundlePath) {
4369
4383
  const { render } = await import(pathToFileURL(ssrBundlePath).href);
4370
4384
  const template = readIndexHtml(outputDirectory);
@@ -4743,7 +4757,7 @@ var ClarifyEngine = class {
4743
4757
  ssrOutDir: ssrOutputDir,
4744
4758
  plugins: this.runtime.ssrPlugins ?? []
4745
4759
  });
4746
- const ssrBundlePath = join(ssrOutputDir, "entry-server.js");
4760
+ const ssrBundlePath = resolveSSRBundlePath(ssrOutputDir);
4747
4761
  await renderSSGRoutes(this.routes, this.runtimeContext(), outputDir, ssrBundlePath);
4748
4762
  } catch (err) {
4749
4763
  console.error("[clarify] SSG failed:", err);
@@ -4790,4 +4804,4 @@ function createClarifyEngine(options = {}) {
4790
4804
  //#endregion
4791
4805
  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 };
4792
4806
 
4793
- //# sourceMappingURL=engine-BgfGFPKK.js.map
4807
+ //# sourceMappingURL=engine-Ccma7jrA.js.map