@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.
- package/output/cli.cjs +1 -1
- package/output/cli.js +1 -1
- package/output/core/runtime/ssg.d.ts +1 -0
- package/output/{engine-CAis1rme.cjs → engine-B_mPOpWr.cjs} +17 -3
- package/output/{engine-CAis1rme.cjs.map → engine-B_mPOpWr.cjs.map} +1 -1
- package/output/{engine-BgfGFPKK.js → engine-Ccma7jrA.js} +17 -3
- package/output/{engine-BgfGFPKK.js.map → engine-Ccma7jrA.js.map} +1 -1
- package/output/index.cjs +1 -1
- package/output/index.js +1 -1
- package/package.json +3 -3
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-B_mPOpWr.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-Ccma7jrA.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>;
|
|
@@ -2265,7 +2265,7 @@ function createViteAdapter(engine) {
|
|
|
2265
2265
|
}
|
|
2266
2266
|
var cliPackageVersion = {
|
|
2267
2267
|
name: "@clarify-labs/cli",
|
|
2268
|
-
version: "0.11.
|
|
2268
|
+
version: "0.11.21",
|
|
2269
2269
|
license: "AGPL-3.0-only",
|
|
2270
2270
|
type: "module",
|
|
2271
2271
|
repository: {
|
|
@@ -4395,6 +4395,20 @@ async function buildSSRBundle(root, ssrEntry, ssrOutDir, plugins) {
|
|
|
4395
4395
|
}
|
|
4396
4396
|
});
|
|
4397
4397
|
}
|
|
4398
|
+
function resolveSSRBundlePath(ssrOutputDir) {
|
|
4399
|
+
for (const entryName of [
|
|
4400
|
+
"entry-server.js",
|
|
4401
|
+
"entry-server.mjs",
|
|
4402
|
+
"entry-server.cjs"
|
|
4403
|
+
]) {
|
|
4404
|
+
const candidate = (0, node_path.join)(ssrOutputDir, entryName);
|
|
4405
|
+
if ((0, node_fs.existsSync)(candidate)) return candidate;
|
|
4406
|
+
}
|
|
4407
|
+
const fallback = (0, node_fs.readdirSync)(ssrOutputDir).filter((name) => name.startsWith("entry-server.")).sort((a, b) => a.localeCompare(b))[0];
|
|
4408
|
+
if (fallback) return (0, node_path.join)(ssrOutputDir, fallback);
|
|
4409
|
+
const files = (0, node_fs.readdirSync)(ssrOutputDir).sort((a, b) => a.localeCompare(b)).slice(0, 20);
|
|
4410
|
+
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)"}`);
|
|
4411
|
+
}
|
|
4398
4412
|
async function renderSSGRoutes(routes, contextOrConfig, outputDirectory, ssrBundlePath) {
|
|
4399
4413
|
const { render } = await import((0, node_url.pathToFileURL)(ssrBundlePath).href);
|
|
4400
4414
|
const template = readIndexHtml(outputDirectory);
|
|
@@ -4773,7 +4787,7 @@ var ClarifyEngine = class {
|
|
|
4773
4787
|
ssrOutDir: ssrOutputDir,
|
|
4774
4788
|
plugins: this.runtime.ssrPlugins ?? []
|
|
4775
4789
|
});
|
|
4776
|
-
const ssrBundlePath = (
|
|
4790
|
+
const ssrBundlePath = resolveSSRBundlePath(ssrOutputDir);
|
|
4777
4791
|
await renderSSGRoutes(this.routes, this.runtimeContext(), outputDir, ssrBundlePath);
|
|
4778
4792
|
} catch (err) {
|
|
4779
4793
|
console.error("[clarify] SSG failed:", err);
|
|
@@ -4891,4 +4905,4 @@ Object.defineProperty(exports, "searchMcpIndex", {
|
|
|
4891
4905
|
}
|
|
4892
4906
|
});
|
|
4893
4907
|
|
|
4894
|
-
//# sourceMappingURL=engine-
|
|
4908
|
+
//# sourceMappingURL=engine-B_mPOpWr.cjs.map
|