@farming-labs/docs 0.1.138 → 0.1.141
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/dist/{agent-BpDMyCrC.mjs → agent-D6yhkz-n.mjs} +2 -2
- package/dist/{agents-B64PilFL.mjs → agents-BbO9u2vP.mjs} +2 -2
- package/dist/cli/index.d.mts +4 -1
- package/dist/cli/index.mjs +35 -28
- package/dist/{cloud-BdSGNsah.mjs → cloud-BFgfAmuX.mjs} +352 -5
- package/dist/{codeblocks-CQ3bD5fQ.mjs → codeblocks-Vzf0AQNa.mjs} +1 -1
- package/dist/{dev-DdlhqXNU.mjs → dev-D58nBPBv.mjs} +2 -2
- package/dist/{doctor-a6opV_tk.mjs → doctor-CzJqqL9p.mjs} +3 -3
- package/dist/{downgrade-BayU3nlg.mjs → downgrade-D45M-NvV.mjs} +2 -2
- package/dist/errors-DqlZftq3.mjs +20 -0
- package/dist/index.d.mts +2 -2
- package/dist/{init-BJqy-LK2.mjs → init-D8Jw1iUE.mjs} +2 -2
- package/dist/{mcp-UECjXigf.mjs → mcp-B_OFsXRH.mjs} +1 -1
- package/dist/mcp.d.mts +1 -1
- package/dist/{package-version-CQm0KO-H.mjs → package-version-DMFdOnyC.mjs} +1 -1
- package/dist/{review-CjyI-bVg.mjs → review-DI_Ht3VO.mjs} +1 -1
- package/dist/{robots-g3-jDypb.mjs → robots-DHQosx37.mjs} +2 -2
- package/dist/{search-Bt8UxDdN.mjs → search-KTntMh-a.mjs} +1 -1
- package/dist/{search-BNCMJUGr.d.mts → search-MyKnoCrX.d.mts} +1 -1
- package/dist/server.d.mts +2 -2
- package/dist/{sitemap-Dxe1lEXx.mjs → sitemap-GEz3BD3H.mjs} +2 -2
- package/dist/{upgrade-DDWolmHe.mjs → upgrade-C1nInojy.mjs} +2 -2
- package/package.json +1 -1
- /package/dist/{config-CBoixmrv.mjs → config-rHQQuz98.mjs} +0 -0
- /package/dist/{templates-DomB3eeS.mjs → templates-JtyB8x53.mjs} +0 -0
- /package/dist/{types-DC1QpBmS.d.mts → types-CwsXQ_v1.d.mts} +0 -0
- /package/dist/{utils-x5EtYWjC.mjs → utils-CGlOADu1.mjs} +0 -0
|
@@ -2,7 +2,7 @@ import "./reading-time-DPAazAGu.mjs";
|
|
|
2
2
|
import "./agent-B7T4gauS.mjs";
|
|
3
3
|
import "./robots-CDdD2o-Q.mjs";
|
|
4
4
|
import "./sitemap-server-idLUrmmU.mjs";
|
|
5
|
-
import "./config-
|
|
6
|
-
import { a as readPageTokenBudget, i as printAgentCompactHelp, n as inspectAgentCompactionState, o as scanDocsPageTargets, r as parseAgentCompactArgs, t as compactAgentDocs } from "./codeblocks-
|
|
5
|
+
import "./config-rHQQuz98.mjs";
|
|
6
|
+
import { a as readPageTokenBudget, i as printAgentCompactHelp, n as inspectAgentCompactionState, o as scanDocsPageTargets, r as parseAgentCompactArgs, t as compactAgentDocs } from "./codeblocks-Vzf0AQNa.mjs";
|
|
7
7
|
|
|
8
8
|
export { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp };
|
|
@@ -2,8 +2,8 @@ import { G as renderDocsAgentsDocument, X as resolveDocsAgentFeedbackConfig, a a
|
|
|
2
2
|
import { S as resolveApiReferenceConfig } from "./sitemap-server-idLUrmmU.mjs";
|
|
3
3
|
import { resolveDocsMcpConfig } from "./mcp.mjs";
|
|
4
4
|
import "./server.mjs";
|
|
5
|
-
import { c as readNavTitle, f as readTopLevelStringProperty, i as loadDocsConfigModule, o as readBooleanProperty, p as resolveDocsConfigPath, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-
|
|
6
|
-
import { t as detectFramework } from "./utils-
|
|
5
|
+
import { c as readNavTitle, f as readTopLevelStringProperty, i as loadDocsConfigModule, o as readBooleanProperty, p as resolveDocsConfigPath, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-rHQQuz98.mjs";
|
|
6
|
+
import { t as detectFramework } from "./utils-CGlOADu1.mjs";
|
|
7
7
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import pc from "picocolors";
|
package/dist/cli/index.d.mts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
//#region src/cli/errors.d.ts
|
|
2
|
+
declare function formatCliError(error: unknown): string;
|
|
3
|
+
//#endregion
|
|
1
4
|
//#region src/cli/index.d.ts
|
|
2
5
|
declare const UPGRADE_TAGS: readonly ["latest", "beta"];
|
|
3
6
|
type UpgradeTag = (typeof UPGRADE_TAGS)[number];
|
|
@@ -9,4 +12,4 @@ declare function parseCommandAlias(rawCommand?: string): {
|
|
|
9
12
|
/** Parse flags like --template next, --name my-docs, --theme concrete, --entry docs, --framework astro (exported for tests). */
|
|
10
13
|
declare function parseFlags(argv: string[]): Record<string, string | boolean | undefined>;
|
|
11
14
|
//#endregion
|
|
12
|
-
export { parseCommandAlias, parseFlags };
|
|
15
|
+
export { formatCliError, parseCommandAlias, parseFlags };
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { i as wasCliErrorReported, r as shouldPrintStackTrace, t as formatCliError } from "../errors-DqlZftq3.mjs";
|
|
2
3
|
import pc from "picocolors";
|
|
3
4
|
|
|
4
5
|
//#region src/cli/index.ts
|
|
@@ -81,40 +82,44 @@ async function main() {
|
|
|
81
82
|
configPath: typeof flags.config === "string" ? flags.config : void 0,
|
|
82
83
|
apiBaseUrl: typeof flags["api-base-url"] === "string" ? flags["api-base-url"] : typeof flags.url === "string" ? flags.url : void 0,
|
|
83
84
|
apiKey: typeof flags["api-key"] === "string" ? flags["api-key"] : void 0,
|
|
85
|
+
apiKeyEnv: typeof flags["api-key-env"] === "string" ? flags["api-key-env"] : void 0,
|
|
84
86
|
json: typeof flags.json === "boolean" ? flags.json : void 0
|
|
85
87
|
};
|
|
86
88
|
if (!parsedCommand.command || parsedCommand.command === "init") {
|
|
87
|
-
const { init } = await import("../init-
|
|
89
|
+
const { init } = await import("../init-D8Jw1iUE.mjs");
|
|
88
90
|
await init(initOptions);
|
|
89
91
|
} else if (parsedCommand.command === "dev") {
|
|
90
|
-
const { dev } = await import("../dev-
|
|
92
|
+
const { dev } = await import("../dev-D58nBPBv.mjs");
|
|
91
93
|
await dev(devOptions);
|
|
92
94
|
} else if (parsedCommand.command === "deploy") {
|
|
93
|
-
const { runCloudDeploy } = await import("../cloud-
|
|
95
|
+
const { runCloudDeploy } = await import("../cloud-BFgfAmuX.mjs");
|
|
94
96
|
await runCloudDeploy(cloudOptions);
|
|
95
97
|
} else if (parsedCommand.command === "preview") {
|
|
96
|
-
const { runCloudPreview } = await import("../cloud-
|
|
98
|
+
const { runCloudPreview } = await import("../cloud-BFgfAmuX.mjs");
|
|
97
99
|
await runCloudPreview(cloudOptions);
|
|
98
100
|
} else if (parsedCommand.command === "cloud" && subcommand === "deploy") {
|
|
99
|
-
const { runCloudDeploy } = await import("../cloud-
|
|
101
|
+
const { runCloudDeploy } = await import("../cloud-BFgfAmuX.mjs");
|
|
100
102
|
await runCloudDeploy(cloudOptions);
|
|
101
103
|
} else if (parsedCommand.command === "cloud" && subcommand === "preview") {
|
|
102
|
-
const { runCloudPreview } = await import("../cloud-
|
|
104
|
+
const { runCloudPreview } = await import("../cloud-BFgfAmuX.mjs");
|
|
103
105
|
await runCloudPreview(cloudOptions);
|
|
106
|
+
} else if (parsedCommand.command === "cloud" && subcommand === "init") {
|
|
107
|
+
const { runCloudInit } = await import("../cloud-BFgfAmuX.mjs");
|
|
108
|
+
await runCloudInit(cloudOptions);
|
|
104
109
|
} else if (parsedCommand.command === "cloud" && subcommand === "sync") {
|
|
105
|
-
const { syncCloudConfig } = await import("../cloud-
|
|
110
|
+
const { syncCloudConfig } = await import("../cloud-BFgfAmuX.mjs");
|
|
106
111
|
await syncCloudConfig(cloudOptions);
|
|
107
112
|
} else if (parsedCommand.command === "cloud") {
|
|
108
113
|
console.error(pc.red(`Unknown cloud subcommand: ${subcommand ?? "(missing)"}`));
|
|
109
114
|
console.error();
|
|
110
|
-
const { printCloudHelp } = await import("../cloud-
|
|
115
|
+
const { printCloudHelp } = await import("../cloud-BFgfAmuX.mjs");
|
|
111
116
|
printCloudHelp();
|
|
112
117
|
process.exit(1);
|
|
113
118
|
} else if (parsedCommand.command === "mcp") {
|
|
114
|
-
const { runMcp } = await import("../mcp-
|
|
119
|
+
const { runMcp } = await import("../mcp-B_OFsXRH.mjs");
|
|
115
120
|
await runMcp(mcpOptions);
|
|
116
121
|
} else if (parsedCommand.command === "agent" && subcommand === "compact") {
|
|
117
|
-
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-
|
|
122
|
+
const { compactAgentDocs, parseAgentCompactArgs, printAgentCompactHelp } = await import("../agent-D6yhkz-n.mjs");
|
|
118
123
|
const agentCompactOptions = parseAgentCompactArgs(args.slice(2));
|
|
119
124
|
if (agentCompactOptions.help) {
|
|
120
125
|
printAgentCompactHelp();
|
|
@@ -124,11 +129,11 @@ async function main() {
|
|
|
124
129
|
} else if (parsedCommand.command === "agent") {
|
|
125
130
|
console.error(pc.red(`Unknown agent subcommand: ${subcommand ?? "(missing)"}`));
|
|
126
131
|
console.error();
|
|
127
|
-
const { printAgentCompactHelp } = await import("../agent-
|
|
132
|
+
const { printAgentCompactHelp } = await import("../agent-D6yhkz-n.mjs");
|
|
128
133
|
printAgentCompactHelp();
|
|
129
134
|
process.exit(1);
|
|
130
135
|
} else if (parsedCommand.command === "agents" && subcommand === "generate") {
|
|
131
|
-
const { generateAgents, parseAgentsGenerateArgs, printAgentsGenerateHelp } = await import("../agents-
|
|
136
|
+
const { generateAgents, parseAgentsGenerateArgs, printAgentsGenerateHelp } = await import("../agents-BbO9u2vP.mjs");
|
|
132
137
|
const agentsOptions = parseAgentsGenerateArgs(args.slice(2));
|
|
133
138
|
if (agentsOptions.help) {
|
|
134
139
|
printAgentsGenerateHelp();
|
|
@@ -138,11 +143,11 @@ async function main() {
|
|
|
138
143
|
} else if (parsedCommand.command === "agents") {
|
|
139
144
|
console.error(pc.red(`Unknown agents subcommand: ${subcommand ?? "(missing)"}`));
|
|
140
145
|
console.error();
|
|
141
|
-
const { printAgentsGenerateHelp } = await import("../agents-
|
|
146
|
+
const { printAgentsGenerateHelp } = await import("../agents-BbO9u2vP.mjs");
|
|
142
147
|
printAgentsGenerateHelp();
|
|
143
148
|
process.exit(1);
|
|
144
149
|
} else if (parsedCommand.command === "doctor") {
|
|
145
|
-
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-
|
|
150
|
+
const { parseDoctorArgs, printDoctorHelp, runDoctor } = await import("../doctor-CzJqqL9p.mjs");
|
|
146
151
|
const doctorOptions = parseDoctorArgs(args.slice(1));
|
|
147
152
|
if (doctorOptions.help) {
|
|
148
153
|
printDoctorHelp();
|
|
@@ -150,7 +155,7 @@ async function main() {
|
|
|
150
155
|
}
|
|
151
156
|
await runDoctor(doctorOptions);
|
|
152
157
|
} else if (parsedCommand.command === "review") {
|
|
153
|
-
const { parseReviewArgs, printReviewHelp, runReview } = await import("../review-
|
|
158
|
+
const { parseReviewArgs, printReviewHelp, runReview } = await import("../review-DI_Ht3VO.mjs");
|
|
154
159
|
const reviewOptions = parseReviewArgs(args.slice(1));
|
|
155
160
|
if (reviewOptions.help) {
|
|
156
161
|
printReviewHelp();
|
|
@@ -158,7 +163,7 @@ async function main() {
|
|
|
158
163
|
}
|
|
159
164
|
await runReview(reviewOptions);
|
|
160
165
|
} else if ((parsedCommand.command === "codeblocks" || parsedCommand.command === "code-blocks") && subcommand === "validate") {
|
|
161
|
-
const { parseCodeBlocksValidateArgs, printCodeBlocksValidateHelp, runCodeBlocksValidate } = await import("../codeblocks-
|
|
166
|
+
const { parseCodeBlocksValidateArgs, printCodeBlocksValidateHelp, runCodeBlocksValidate } = await import("../codeblocks-Vzf0AQNa.mjs");
|
|
162
167
|
const codeBlocksOptions = parseCodeBlocksValidateArgs(args.slice(2));
|
|
163
168
|
if (codeBlocksOptions.help) {
|
|
164
169
|
printCodeBlocksValidateHelp();
|
|
@@ -168,11 +173,11 @@ async function main() {
|
|
|
168
173
|
} else if (parsedCommand.command === "codeblocks" || parsedCommand.command === "code-blocks") {
|
|
169
174
|
console.error(pc.red(`Unknown codeblocks subcommand: ${subcommand ?? "(missing)"}`));
|
|
170
175
|
console.error();
|
|
171
|
-
const { printCodeBlocksValidateHelp } = await import("../codeblocks-
|
|
176
|
+
const { printCodeBlocksValidateHelp } = await import("../codeblocks-Vzf0AQNa.mjs");
|
|
172
177
|
printCodeBlocksValidateHelp();
|
|
173
178
|
process.exit(1);
|
|
174
179
|
} else if (parsedCommand.command === "search" && subcommand === "sync") {
|
|
175
|
-
const { syncSearch } = await import("../search-
|
|
180
|
+
const { syncSearch } = await import("../search-KTntMh-a.mjs");
|
|
176
181
|
await syncSearch(searchSyncOptions);
|
|
177
182
|
} else if (parsedCommand.command === "search") {
|
|
178
183
|
console.error(pc.red(`Unknown search subcommand: ${subcommand ?? "(missing)"}`));
|
|
@@ -180,7 +185,7 @@ async function main() {
|
|
|
180
185
|
printHelp();
|
|
181
186
|
process.exit(1);
|
|
182
187
|
} else if (parsedCommand.command === "sitemap" && subcommand === "generate") {
|
|
183
|
-
const { generateSitemap, parseSitemapGenerateArgs, printSitemapGenerateHelp } = await import("../sitemap-
|
|
188
|
+
const { generateSitemap, parseSitemapGenerateArgs, printSitemapGenerateHelp } = await import("../sitemap-GEz3BD3H.mjs");
|
|
184
189
|
const sitemapOptions = parseSitemapGenerateArgs(args.slice(2));
|
|
185
190
|
if (sitemapOptions.help) {
|
|
186
191
|
printSitemapGenerateHelp();
|
|
@@ -190,11 +195,11 @@ async function main() {
|
|
|
190
195
|
} else if (parsedCommand.command === "sitemap") {
|
|
191
196
|
console.error(pc.red(`Unknown sitemap subcommand: ${subcommand ?? "(missing)"}`));
|
|
192
197
|
console.error();
|
|
193
|
-
const { printSitemapGenerateHelp } = await import("../sitemap-
|
|
198
|
+
const { printSitemapGenerateHelp } = await import("../sitemap-GEz3BD3H.mjs");
|
|
194
199
|
printSitemapGenerateHelp();
|
|
195
200
|
process.exit(1);
|
|
196
201
|
} else if (parsedCommand.command === "robots" && subcommand === "generate") {
|
|
197
|
-
const { generateRobots, parseRobotsGenerateArgs, printRobotsGenerateHelp } = await import("../robots-
|
|
202
|
+
const { generateRobots, parseRobotsGenerateArgs, printRobotsGenerateHelp } = await import("../robots-DHQosx37.mjs");
|
|
198
203
|
const robotsOptions = parseRobotsGenerateArgs(args.slice(2));
|
|
199
204
|
if (robotsOptions.help) {
|
|
200
205
|
printRobotsGenerateHelp();
|
|
@@ -204,11 +209,11 @@ async function main() {
|
|
|
204
209
|
} else if (parsedCommand.command === "robots") {
|
|
205
210
|
console.error(pc.red(`Unknown robots subcommand: ${subcommand ?? "(missing)"}`));
|
|
206
211
|
console.error();
|
|
207
|
-
const { printRobotsGenerateHelp } = await import("../robots-
|
|
212
|
+
const { printRobotsGenerateHelp } = await import("../robots-DHQosx37.mjs");
|
|
208
213
|
printRobotsGenerateHelp();
|
|
209
214
|
process.exit(1);
|
|
210
215
|
} else if (parsedCommand.command === "downgrade") {
|
|
211
|
-
const { downgrade } = await import("../downgrade-
|
|
216
|
+
const { downgrade } = await import("../downgrade-D45M-NvV.mjs");
|
|
212
217
|
const framework = (typeof flags.framework === "string" ? flags.framework : void 0) ?? (args[1] && !args[1].startsWith("--") ? args[1] : void 0);
|
|
213
218
|
const hasVersionFlag = args.includes("--version") || args.some((arg) => arg.startsWith("--version="));
|
|
214
219
|
await downgrade({
|
|
@@ -216,7 +221,7 @@ async function main() {
|
|
|
216
221
|
version: typeof flags.version === "string" ? flags.version : hasVersionFlag ? "" : void 0
|
|
217
222
|
});
|
|
218
223
|
} else if (parsedCommand.command === "upgrade") {
|
|
219
|
-
const { upgrade } = await import("../upgrade-
|
|
224
|
+
const { upgrade } = await import("../upgrade-C1nInojy.mjs");
|
|
220
225
|
const framework = (typeof flags.framework === "string" ? flags.framework : void 0) ?? (args[1] && !args[1].startsWith("--") ? args[1] : void 0);
|
|
221
226
|
const hasVersionFlag = args.includes("--version") || args.some((arg) => arg.startsWith("--version="));
|
|
222
227
|
const version = typeof flags.version === "string" ? flags.version : hasVersionFlag ? "" : void 0;
|
|
@@ -246,7 +251,7 @@ ${pc.dim("Commands:")}
|
|
|
246
251
|
${pc.cyan("dev")} Run frameworkless docs locally from ${pc.dim("docs.json")}
|
|
247
252
|
${pc.cyan("deploy")} Sync cloud config and deploy hosted preview docs
|
|
248
253
|
${pc.cyan("preview")} Alias for ${pc.cyan("deploy")}
|
|
249
|
-
${pc.cyan("cloud")} Docs Cloud utilities (${pc.dim("deploy")}, ${pc.dim("preview")}, ${pc.dim("sync")})
|
|
254
|
+
${pc.cyan("cloud")} Docs Cloud utilities (${pc.dim("init")}, ${pc.dim("deploy")}, ${pc.dim("preview")}, ${pc.dim("sync")})
|
|
250
255
|
${pc.cyan("agent")} Agent utilities (${pc.dim("compact")} to generate sibling agent.md files)
|
|
251
256
|
${pc.cyan("agents")} AGENTS.md utilities (${pc.dim("generate")} for static agent instructions)
|
|
252
257
|
${pc.cyan("doctor")} Inspect and score agent or reader-facing docs quality
|
|
@@ -281,12 +286,14 @@ ${pc.dim("Options for dev:")}
|
|
|
281
286
|
${pc.cyan("--verbose")} Show raw runtime logs in addition to branded CLI output
|
|
282
287
|
|
|
283
288
|
${pc.dim("Options for cloud deploy:")}
|
|
289
|
+
${pc.cyan("cloud init")} Add Docs Cloud config to ${pc.dim("docs.config.ts")} and ${pc.dim("docs.json")}
|
|
284
290
|
${pc.cyan("deploy")} Sync ${pc.dim("docs.config.ts")} into ${pc.dim("docs.json")} and deploy hosted preview docs
|
|
285
291
|
${pc.cyan("cloud deploy")} Same as ${pc.cyan("deploy")}
|
|
286
292
|
${pc.cyan("preview")} Alias for ${pc.cyan("deploy")}
|
|
287
293
|
${pc.cyan("cloud preview")} Compatibility alias for ${pc.cyan("cloud deploy")}
|
|
288
294
|
${pc.cyan("cloud sync")} Only materialize cloud settings into ${pc.dim("docs.json")}
|
|
289
295
|
${pc.cyan("--config <path>")} Use a custom docs config path
|
|
296
|
+
${pc.cyan("--api-key-env <name>")} Env var that stores the Docs Cloud API key
|
|
290
297
|
${pc.cyan("--api-base-url <url>")} Override the Docs Cloud API base URL
|
|
291
298
|
${pc.cyan("--api-key <key>")} Use an API key directly; prefer ${pc.dim("cloud.apiKey.env")}
|
|
292
299
|
${pc.cyan("--json")} Print machine-readable output
|
|
@@ -379,10 +386,10 @@ function printVersion() {
|
|
|
379
386
|
console.log("0.1.0");
|
|
380
387
|
}
|
|
381
388
|
main().catch((err) => {
|
|
382
|
-
console.error(
|
|
383
|
-
console.error(err);
|
|
389
|
+
if (shouldPrintStackTrace()) console.error(err);
|
|
390
|
+
else if (!wasCliErrorReported(err)) console.error(pc.red(`Error: ${formatCliError(err)}`));
|
|
384
391
|
process.exit(1);
|
|
385
392
|
});
|
|
386
393
|
|
|
387
394
|
//#endregion
|
|
388
|
-
export { parseCommandAlias, parseFlags };
|
|
395
|
+
export { formatCliError, parseCommandAlias, parseFlags };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
1
|
+
import { n as markCliErrorReported } from "./errors-DqlZftq3.mjs";
|
|
2
|
+
import { a as loadProjectEnv, c as readNavTitle, d as readTopLevelBooleanProperty, f as readTopLevelStringProperty, i as loadDocsConfigModule, m as resolveDocsContentDir, p as resolveDocsConfigPath, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-rHQQuz98.mjs";
|
|
3
|
+
import { t as detectFramework } from "./utils-CGlOADu1.mjs";
|
|
3
4
|
import fs from "node:fs";
|
|
4
5
|
import path from "node:path";
|
|
5
6
|
import pc from "picocolors";
|
|
@@ -9,6 +10,8 @@ import { execFileSync } from "node:child_process";
|
|
|
9
10
|
const DOCS_JSON_FILE = "docs.json";
|
|
10
11
|
const DOCS_CLOUD_SCHEMA_URL = "https://docs.farming-labs.dev/schema/docs.json";
|
|
11
12
|
const DOCS_CLOUD_DEFAULT_API_KEY_ENV = "DOCS_CLOUD_API_KEY";
|
|
13
|
+
const DOCS_CLOUD_DEFAULT_ANALYTICS_PROJECT_ID_ENV = "NEXT_PUBLIC_DOCS_CLOUD_PROJECT_ID";
|
|
14
|
+
const DOCS_CLOUD_MISSING_API_KEY_DOCS_URL = "https://docs.farming-labs.dev/docs/cloud/deploy#missing-api-key";
|
|
12
15
|
const DEFAULT_DOCS_CLOUD_API_BASE_URL = "https://docs-app.farming-labs.dev";
|
|
13
16
|
const DEFAULT_PREVIEW_TIMEOUT_MS = 300 * 1e3;
|
|
14
17
|
const DEFAULT_PREVIEW_POLL_INTERVAL_MS = 2e3;
|
|
@@ -112,6 +115,299 @@ async function loadDocsConfigSnapshot(rootDir, explicitPath) {
|
|
|
112
115
|
config: (await loadDocsConfigModule(rootDir, configPath, { silent: true }))?.config
|
|
113
116
|
};
|
|
114
117
|
}
|
|
118
|
+
function escapeRegExp(value) {
|
|
119
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
120
|
+
}
|
|
121
|
+
function findBalancedBraceEnd(content, braceStart) {
|
|
122
|
+
let depth = 0;
|
|
123
|
+
let stringQuote = null;
|
|
124
|
+
let escaped = false;
|
|
125
|
+
let lineComment = false;
|
|
126
|
+
let blockComment = false;
|
|
127
|
+
for (let index = braceStart; index < content.length; index += 1) {
|
|
128
|
+
const char = content[index];
|
|
129
|
+
const next = content[index + 1];
|
|
130
|
+
if (lineComment) {
|
|
131
|
+
if (char === "\n") lineComment = false;
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
if (blockComment) {
|
|
135
|
+
if (char === "*" && next === "/") {
|
|
136
|
+
blockComment = false;
|
|
137
|
+
index += 1;
|
|
138
|
+
}
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
if (stringQuote) {
|
|
142
|
+
if (escaped) {
|
|
143
|
+
escaped = false;
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
if (char === "\\") {
|
|
147
|
+
escaped = true;
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
if (char === stringQuote) stringQuote = null;
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
if (char === "/" && next === "/") {
|
|
154
|
+
lineComment = true;
|
|
155
|
+
index += 1;
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
if (char === "/" && next === "*") {
|
|
159
|
+
blockComment = true;
|
|
160
|
+
index += 1;
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
if (char === "\"" || char === "'" || char === "`") {
|
|
164
|
+
stringQuote = char;
|
|
165
|
+
continue;
|
|
166
|
+
}
|
|
167
|
+
if (char === "{") {
|
|
168
|
+
depth += 1;
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
if (char !== "}") continue;
|
|
172
|
+
depth -= 1;
|
|
173
|
+
if (depth === 0) return index;
|
|
174
|
+
}
|
|
175
|
+
return -1;
|
|
176
|
+
}
|
|
177
|
+
function findConfigObjectRange(content) {
|
|
178
|
+
for (const marker of ["defineDocs(", "export default"]) {
|
|
179
|
+
const markerIndex = content.indexOf(marker);
|
|
180
|
+
if (markerIndex === -1) continue;
|
|
181
|
+
const braceStart = content.indexOf("{", markerIndex);
|
|
182
|
+
if (braceStart === -1) continue;
|
|
183
|
+
const braceEnd = findBalancedBraceEnd(content, braceStart);
|
|
184
|
+
if (braceEnd === -1) continue;
|
|
185
|
+
return {
|
|
186
|
+
braceStart,
|
|
187
|
+
braceEnd,
|
|
188
|
+
bodyStart: braceStart + 1,
|
|
189
|
+
bodyEnd: braceEnd
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
function stripLeadingPropertyTrivia(content) {
|
|
194
|
+
let current = content;
|
|
195
|
+
while (true) {
|
|
196
|
+
const trimmed = current.replace(/^\s+/, "");
|
|
197
|
+
if (trimmed.startsWith("//")) {
|
|
198
|
+
const lineEnd = trimmed.indexOf("\n");
|
|
199
|
+
current = lineEnd === -1 ? "" : trimmed.slice(lineEnd + 1);
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
if (trimmed.startsWith("/*")) {
|
|
203
|
+
const blockEnd = trimmed.indexOf("*/");
|
|
204
|
+
current = blockEnd === -1 ? "" : trimmed.slice(blockEnd + 2);
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
return trimmed;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
function propertyStartsWithKey(property, key) {
|
|
211
|
+
return new RegExp(`^${escapeRegExp(key)}\\s*:`).test(stripLeadingPropertyTrivia(property));
|
|
212
|
+
}
|
|
213
|
+
function findTopLevelPropertyRange(content, bodyStart, bodyEnd, key) {
|
|
214
|
+
let start = bodyStart;
|
|
215
|
+
let stringQuote = null;
|
|
216
|
+
let escaped = false;
|
|
217
|
+
let lineComment = false;
|
|
218
|
+
let blockComment = false;
|
|
219
|
+
let braceDepth = 0;
|
|
220
|
+
let bracketDepth = 0;
|
|
221
|
+
let parenDepth = 0;
|
|
222
|
+
const maybeMatch = (end) => {
|
|
223
|
+
if (!propertyStartsWithKey(content.slice(start, end), key)) return void 0;
|
|
224
|
+
return {
|
|
225
|
+
start,
|
|
226
|
+
end
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
for (let index = bodyStart; index <= bodyEnd; index += 1) {
|
|
230
|
+
const char = content[index];
|
|
231
|
+
const next = content[index + 1];
|
|
232
|
+
if (index === bodyEnd) return maybeMatch(index);
|
|
233
|
+
if (lineComment) {
|
|
234
|
+
if (char === "\n") lineComment = false;
|
|
235
|
+
continue;
|
|
236
|
+
}
|
|
237
|
+
if (blockComment) {
|
|
238
|
+
if (char === "*" && next === "/") {
|
|
239
|
+
blockComment = false;
|
|
240
|
+
index += 1;
|
|
241
|
+
}
|
|
242
|
+
continue;
|
|
243
|
+
}
|
|
244
|
+
if (stringQuote) {
|
|
245
|
+
if (escaped) {
|
|
246
|
+
escaped = false;
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
if (char === "\\") {
|
|
250
|
+
escaped = true;
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
253
|
+
if (char === stringQuote) stringQuote = null;
|
|
254
|
+
continue;
|
|
255
|
+
}
|
|
256
|
+
if (char === "/" && next === "/") {
|
|
257
|
+
lineComment = true;
|
|
258
|
+
index += 1;
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
if (char === "/" && next === "*") {
|
|
262
|
+
blockComment = true;
|
|
263
|
+
index += 1;
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
if (char === "\"" || char === "'" || char === "`") {
|
|
267
|
+
stringQuote = char;
|
|
268
|
+
continue;
|
|
269
|
+
}
|
|
270
|
+
if (char === "{") {
|
|
271
|
+
braceDepth += 1;
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
274
|
+
if (char === "}") {
|
|
275
|
+
braceDepth = Math.max(0, braceDepth - 1);
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
278
|
+
if (char === "[") {
|
|
279
|
+
bracketDepth += 1;
|
|
280
|
+
continue;
|
|
281
|
+
}
|
|
282
|
+
if (char === "]") {
|
|
283
|
+
bracketDepth = Math.max(0, bracketDepth - 1);
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
if (char === "(") {
|
|
287
|
+
parenDepth += 1;
|
|
288
|
+
continue;
|
|
289
|
+
}
|
|
290
|
+
if (char === ")") {
|
|
291
|
+
parenDepth = Math.max(0, parenDepth - 1);
|
|
292
|
+
continue;
|
|
293
|
+
}
|
|
294
|
+
if (char !== "," || braceDepth !== 0 || bracketDepth !== 0 || parenDepth !== 0) continue;
|
|
295
|
+
const match = maybeMatch(index);
|
|
296
|
+
if (match) return match;
|
|
297
|
+
start = index + 1;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
function findObjectPropertyRange(content, object, key) {
|
|
301
|
+
const property = findTopLevelPropertyRange(content, object.bodyStart, object.bodyEnd, key);
|
|
302
|
+
if (!property) return void 0;
|
|
303
|
+
const colon = content.indexOf(":", property.start);
|
|
304
|
+
const braceStart = content.indexOf("{", colon);
|
|
305
|
+
if (colon === -1 || braceStart === -1 || braceStart > property.end) return void 0;
|
|
306
|
+
const braceEnd = findBalancedBraceEnd(content, braceStart);
|
|
307
|
+
if (braceEnd === -1 || braceEnd > property.end) return void 0;
|
|
308
|
+
return {
|
|
309
|
+
braceStart,
|
|
310
|
+
braceEnd,
|
|
311
|
+
bodyStart: braceStart + 1,
|
|
312
|
+
bodyEnd: braceEnd
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
function lineIndentAt(content, index) {
|
|
316
|
+
const lineStart = content.lastIndexOf("\n", index - 1) + 1;
|
|
317
|
+
return content.slice(lineStart, index).match(/^\s*/)?.[0] ?? "";
|
|
318
|
+
}
|
|
319
|
+
function insertObjectProperties(content, object, properties) {
|
|
320
|
+
if (properties.length === 0) return content;
|
|
321
|
+
const body = content.slice(object.bodyStart, object.bodyEnd);
|
|
322
|
+
const closingIndent = lineIndentAt(content, object.braceEnd);
|
|
323
|
+
const beforeObjectClose = content.slice(0, object.bodyEnd).replace(/\s*$/, "");
|
|
324
|
+
const suffix = content.slice(object.bodyEnd);
|
|
325
|
+
return `${beforeObjectClose}${body.trim().length > 0 && !beforeObjectClose.endsWith(",") ? "," : ""}\n${properties.join("\n")}\n${closingIndent}${suffix}`;
|
|
326
|
+
}
|
|
327
|
+
function renderAnalyticsConfigProperty(indent) {
|
|
328
|
+
return `${indent}analytics: {
|
|
329
|
+
${indent} enabled: true,
|
|
330
|
+
${indent} console: false,
|
|
331
|
+
${indent} includeInputs: false,
|
|
332
|
+
${indent}},`;
|
|
333
|
+
}
|
|
334
|
+
function renderCloudConfigProperty(indent, apiKeyEnv) {
|
|
335
|
+
return `${indent}cloud: {
|
|
336
|
+
${indent} apiKey: { env: ${JSON.stringify(apiKeyEnv)} },
|
|
337
|
+
${indent} deploy: { enabled: true },
|
|
338
|
+
${indent} analytics: {
|
|
339
|
+
${indent} enabled: true,
|
|
340
|
+
${indent} console: false,
|
|
341
|
+
${indent} includeInputs: false,
|
|
342
|
+
${indent} },
|
|
343
|
+
${indent} publish: { mode: "draft-pr", baseBranch: "main" },
|
|
344
|
+
${indent}},`;
|
|
345
|
+
}
|
|
346
|
+
function renderCloudInitDocsConfig(apiKeyEnv) {
|
|
347
|
+
return `import { defineDocs } from "@farming-labs/docs";
|
|
348
|
+
|
|
349
|
+
export default defineDocs({
|
|
350
|
+
${renderAnalyticsConfigProperty(" ")}
|
|
351
|
+
${renderCloudConfigProperty(" ", apiKeyEnv)}
|
|
352
|
+
});
|
|
353
|
+
`;
|
|
354
|
+
}
|
|
355
|
+
function normalizeEnvName(value, fallback) {
|
|
356
|
+
const normalized = value?.trim();
|
|
357
|
+
if (!normalized) return fallback;
|
|
358
|
+
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(normalized)) throw new Error(`Invalid environment variable name: ${normalized}`);
|
|
359
|
+
return normalized;
|
|
360
|
+
}
|
|
361
|
+
function ensureDocsConfigCloudInit(options) {
|
|
362
|
+
const resolvedConfigPath = tryResolveDocsConfigPath(options.rootDir, options.configPath);
|
|
363
|
+
const configPath = resolvedConfigPath ?? path.join(options.rootDir, "docs.config.ts");
|
|
364
|
+
if (!resolvedConfigPath) {
|
|
365
|
+
fs.writeFileSync(configPath, renderCloudInitDocsConfig(options.apiKeyEnv), "utf-8");
|
|
366
|
+
return {
|
|
367
|
+
configPath,
|
|
368
|
+
created: true,
|
|
369
|
+
updated: true
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
const original = fs.readFileSync(configPath, "utf-8");
|
|
373
|
+
let content = original;
|
|
374
|
+
let configObject = findConfigObjectRange(content);
|
|
375
|
+
if (!configObject) throw new Error(`Could not find an object export in ${path.relative(options.rootDir, configPath)}. Use defineDocs({ ... }) or export default { ... } before running cloud init.`);
|
|
376
|
+
const topLevelIndent = `${lineIndentAt(content, configObject.braceEnd)} `;
|
|
377
|
+
const cloudProperty = findTopLevelPropertyRange(content, configObject.bodyStart, configObject.bodyEnd, "cloud");
|
|
378
|
+
let cloudObject = findObjectPropertyRange(content, configObject, "cloud");
|
|
379
|
+
if (!cloudProperty) content = insertObjectProperties(content, configObject, [renderCloudConfigProperty(topLevelIndent, options.apiKeyEnv)]);
|
|
380
|
+
else if (!cloudObject) throw new Error(`Could not update cloud config in ${path.relative(options.rootDir, configPath)} because cloud is not an object literal.`);
|
|
381
|
+
configObject = findConfigObjectRange(content);
|
|
382
|
+
if (!configObject) throw new Error(`Could not re-read ${path.relative(options.rootDir, configPath)}.`);
|
|
383
|
+
cloudObject = findObjectPropertyRange(content, configObject, "cloud");
|
|
384
|
+
if (cloudObject) {
|
|
385
|
+
const cloudIndent = `${lineIndentAt(content, cloudObject.braceEnd)} `;
|
|
386
|
+
const missingCloudProperties = [];
|
|
387
|
+
if (!findTopLevelPropertyRange(content, cloudObject.bodyStart, cloudObject.bodyEnd, "apiKey")) missingCloudProperties.push(`${cloudIndent}apiKey: { env: ${JSON.stringify(options.apiKeyEnv)} },`);
|
|
388
|
+
else {
|
|
389
|
+
const apiKeyObject = findObjectPropertyRange(content, cloudObject, "apiKey");
|
|
390
|
+
if (apiKeyObject && !findTopLevelPropertyRange(content, apiKeyObject.bodyStart, apiKeyObject.bodyEnd, "env")) {
|
|
391
|
+
content = insertObjectProperties(content, apiKeyObject, [`${lineIndentAt(content, apiKeyObject.braceEnd)} env: ${JSON.stringify(options.apiKeyEnv)},`]);
|
|
392
|
+
configObject = findConfigObjectRange(content);
|
|
393
|
+
cloudObject = findObjectPropertyRange(content, configObject, "cloud");
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
if (!findTopLevelPropertyRange(content, cloudObject.bodyStart, cloudObject.bodyEnd, "deploy")) missingCloudProperties.push(`${cloudIndent}deploy: { enabled: true },`);
|
|
397
|
+
if (!findTopLevelPropertyRange(content, cloudObject.bodyStart, cloudObject.bodyEnd, "analytics")) missingCloudProperties.push(renderAnalyticsConfigProperty(cloudIndent));
|
|
398
|
+
if (!findTopLevelPropertyRange(content, cloudObject.bodyStart, cloudObject.bodyEnd, "publish")) missingCloudProperties.push(`${cloudIndent}publish: { mode: "draft-pr", baseBranch: "main" },`);
|
|
399
|
+
content = insertObjectProperties(content, cloudObject, missingCloudProperties);
|
|
400
|
+
}
|
|
401
|
+
configObject = findConfigObjectRange(content);
|
|
402
|
+
if (!configObject) throw new Error(`Could not re-read ${path.relative(options.rootDir, configPath)}.`);
|
|
403
|
+
if (!findTopLevelPropertyRange(content, configObject.bodyStart, configObject.bodyEnd, "analytics")) content = insertObjectProperties(content, configObject, [renderAnalyticsConfigProperty(`${lineIndentAt(content, configObject.braceEnd)} `)]);
|
|
404
|
+
if (content !== original) fs.writeFileSync(configPath, content, "utf-8");
|
|
405
|
+
return {
|
|
406
|
+
configPath,
|
|
407
|
+
created: false,
|
|
408
|
+
updated: content !== original
|
|
409
|
+
};
|
|
410
|
+
}
|
|
115
411
|
function readExistingDocsJson(docsJsonPath) {
|
|
116
412
|
if (!fs.existsSync(docsJsonPath)) return void 0;
|
|
117
413
|
try {
|
|
@@ -307,7 +603,7 @@ function resolveApiKey(options, rootDir, envName) {
|
|
|
307
603
|
...process.env
|
|
308
604
|
}[envName]?.trim();
|
|
309
605
|
if (token) return token;
|
|
310
|
-
throw new Error(`Missing Docs Cloud API key. Set ${envName} in your shell or .env.local, or configure cloud.apiKey.env in docs.config.ts.`);
|
|
606
|
+
throw new Error(`Missing Docs Cloud API key. Set ${envName} in your shell or .env.local, or configure cloud.apiKey.env in docs.config.ts. See ${DOCS_CLOUD_MISSING_API_KEY_DOCS_URL}.`);
|
|
311
607
|
}
|
|
312
608
|
async function readJsonResponse(response) {
|
|
313
609
|
const text = await response.text();
|
|
@@ -564,6 +860,51 @@ async function syncCloudConfig(options = {}) {
|
|
|
564
860
|
console.log(`${pc.dim("api key env")} ${result.apiKeyEnv}`);
|
|
565
861
|
return result;
|
|
566
862
|
}
|
|
863
|
+
async function initCloudConfig(options = {}) {
|
|
864
|
+
const rootDir = options.rootDir ?? process.cwd();
|
|
865
|
+
const apiKeyEnv = normalizeEnvName(options.apiKeyEnv, DOCS_CLOUD_DEFAULT_API_KEY_ENV);
|
|
866
|
+
const configUpdate = ensureDocsConfigCloudInit({
|
|
867
|
+
rootDir,
|
|
868
|
+
configPath: options.configPath,
|
|
869
|
+
apiKeyEnv
|
|
870
|
+
});
|
|
871
|
+
const materialized = await materializeCloudConfig({
|
|
872
|
+
...options,
|
|
873
|
+
rootDir,
|
|
874
|
+
configPath: path.relative(rootDir, configUpdate.configPath)
|
|
875
|
+
});
|
|
876
|
+
return {
|
|
877
|
+
configPath: configUpdate.configPath,
|
|
878
|
+
docsJsonPath: materialized.docsJsonPath,
|
|
879
|
+
apiKeyEnv: materialized.apiKeyEnv,
|
|
880
|
+
analyticsProjectIdEnv: DOCS_CLOUD_DEFAULT_ANALYTICS_PROJECT_ID_ENV,
|
|
881
|
+
configCreated: configUpdate.created,
|
|
882
|
+
configUpdated: configUpdate.updated,
|
|
883
|
+
docsJsonCreated: materialized.created,
|
|
884
|
+
docsJsonUpdated: materialized.updated
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
async function runCloudInit(options = {}) {
|
|
888
|
+
const result = await initCloudConfig(options);
|
|
889
|
+
if (options.json) {
|
|
890
|
+
console.log(JSON.stringify(result, null, 2));
|
|
891
|
+
return result;
|
|
892
|
+
}
|
|
893
|
+
const relativeConfigPath = path.relative(process.cwd(), result.configPath) || "docs.config.ts";
|
|
894
|
+
const relativeDocsJsonPath = path.relative(process.cwd(), result.docsJsonPath) || DOCS_JSON_FILE;
|
|
895
|
+
const configAction = result.configCreated ? "Created" : result.configUpdated ? "Updated" : "Checked";
|
|
896
|
+
const docsJsonAction = result.docsJsonCreated ? "created" : result.docsJsonUpdated ? "updated" : "checked";
|
|
897
|
+
console.log(`${pc.green("ok")} ${configAction} ${pc.cyan(relativeConfigPath)}`);
|
|
898
|
+
console.log(`${pc.green("ok")} ${docsJsonAction} ${pc.cyan(relativeDocsJsonPath)}`);
|
|
899
|
+
console.log();
|
|
900
|
+
console.log(pc.bold("Add these env vars"));
|
|
901
|
+
console.log(`${pc.cyan(result.apiKeyEnv)}=${pc.dim("paste_your_docs_cloud_api_key")}`);
|
|
902
|
+
console.log(`${pc.cyan(result.analyticsProjectIdEnv)}=${pc.dim("paste_your_docs_cloud_project_id")}`);
|
|
903
|
+
console.log();
|
|
904
|
+
console.log(pc.dim("Use the same env vars in production. The API key value is never written to config."));
|
|
905
|
+
console.log(pc.dim(`Then run ${pc.cyan("pnpm dlx @farming-labs/docs deploy")}.`));
|
|
906
|
+
return result;
|
|
907
|
+
}
|
|
567
908
|
async function runCloudDeployment(options = {}) {
|
|
568
909
|
const rootDir = options.rootDir ?? process.cwd();
|
|
569
910
|
const spinner = createSpinner("Preparing Docs Cloud deployment", options);
|
|
@@ -608,7 +949,10 @@ async function runCloudDeployment(options = {}) {
|
|
|
608
949
|
return result;
|
|
609
950
|
} catch (error) {
|
|
610
951
|
const message = error instanceof Error ? error.message : String(error);
|
|
611
|
-
|
|
952
|
+
if (!options.json) {
|
|
953
|
+
spinner.fail(message);
|
|
954
|
+
markCliErrorReported(error);
|
|
955
|
+
}
|
|
612
956
|
throw error;
|
|
613
957
|
} finally {
|
|
614
958
|
spinner.stop();
|
|
@@ -625,6 +969,7 @@ function printCloudHelp() {
|
|
|
625
969
|
${pc.bold("@farming-labs/docs cloud")}
|
|
626
970
|
|
|
627
971
|
${pc.dim("Usage:")}
|
|
972
|
+
${pc.cyan("docs cloud init")} Add Docs Cloud config to ${pc.dim("docs.config.ts")} and ${pc.dim("docs.json")}
|
|
628
973
|
${pc.cyan("docs deploy")} Sync ${pc.dim("docs.config.ts")} to ${pc.dim("docs.json")} and deploy hosted preview docs
|
|
629
974
|
${pc.cyan("docs cloud deploy")} Same as ${pc.cyan("docs deploy")}
|
|
630
975
|
${pc.cyan("docs preview")} Compatibility alias for ${pc.cyan("docs deploy")}
|
|
@@ -633,6 +978,7 @@ ${pc.dim("Usage:")}
|
|
|
633
978
|
|
|
634
979
|
${pc.dim("Options:")}
|
|
635
980
|
${pc.cyan("--config <path>")} Use a custom docs config path
|
|
981
|
+
${pc.cyan("--api-key-env <name>")} Env var that stores the Docs Cloud API key
|
|
636
982
|
${pc.cyan("--api-base-url <url>")} Override Docs Cloud API base URL
|
|
637
983
|
${pc.cyan("--api-key <key>")} Use an API key directly; prefer ${pc.dim("cloud.apiKey.env")}
|
|
638
984
|
${pc.cyan("--json")} Print machine-readable output
|
|
@@ -644,10 +990,11 @@ ${pc.dim("Config example:")}
|
|
|
644
990
|
cloud: {
|
|
645
991
|
apiKey: { env: "DOCS_CLOUD_API_KEY" },
|
|
646
992
|
deploy: { enabled: true },
|
|
993
|
+
analytics: { enabled: true, console: false, includeInputs: false },
|
|
647
994
|
publish: { mode: "draft-pr", baseBranch: "main" },
|
|
648
995
|
}
|
|
649
996
|
`);
|
|
650
997
|
}
|
|
651
998
|
|
|
652
999
|
//#endregion
|
|
653
|
-
export { printCloudHelp, runCloudDeploy, runCloudPreview, syncCloudConfig };
|
|
1000
|
+
export { printCloudHelp, runCloudDeploy, runCloudInit, runCloudPreview, syncCloudConfig };
|
|
@@ -3,7 +3,7 @@ import { A as findDocsMarkdownPage, q as renderDocsMarkdownDocument } from "./ag
|
|
|
3
3
|
import "./index.mjs";
|
|
4
4
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
5
5
|
import "./server.mjs";
|
|
6
|
-
import { a as loadProjectEnv, c as readNavTitle, f as readTopLevelStringProperty, i as loadDocsConfigModule, l as readNumberProperty, m as resolveDocsContentDir, o as readBooleanProperty, p as resolveDocsConfigPath, s as readEnvReferenceProperty, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-
|
|
6
|
+
import { a as loadProjectEnv, c as readNavTitle, f as readTopLevelStringProperty, i as loadDocsConfigModule, l as readNumberProperty, m as resolveDocsContentDir, o as readBooleanProperty, p as resolveDocsConfigPath, s as readEnvReferenceProperty, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-rHQQuz98.mjs";
|
|
7
7
|
import matter from "gray-matter";
|
|
8
8
|
import { existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
9
9
|
import path from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as detectPackageManagerFromLockfile } from "./utils-
|
|
2
|
-
import { K as rootLayoutTemplate, W as postcssConfigTemplate, g as docsLayoutTemplate, v as globalCssTemplate, yt as tsconfigTemplate } from "./templates-
|
|
1
|
+
import { i as detectPackageManagerFromLockfile } from "./utils-CGlOADu1.mjs";
|
|
2
|
+
import { K as rootLayoutTemplate, W as postcssConfigTemplate, g as docsLayoutTemplate, v as globalCssTemplate, yt as tsconfigTemplate } from "./templates-JtyB8x53.mjs";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import pc from "picocolors";
|
|
@@ -5,9 +5,9 @@ import { a as analyzeDocsRobotsTxt, n as DEFAULT_ROBOTS_TXT_ROUTE, u as resolveD
|
|
|
5
5
|
import "./sitemap-server-idLUrmmU.mjs";
|
|
6
6
|
import { createFilesystemDocsMcpSource, resolveDocsMcpConfig } from "./mcp.mjs";
|
|
7
7
|
import "./server.mjs";
|
|
8
|
-
import { a as loadProjectEnv, c as readNavTitle, f as readTopLevelStringProperty, i as loadDocsConfigModule, m as resolveDocsContentDir, o as readBooleanProperty, p as resolveDocsConfigPath, r as extractTopLevelConfigObject, t as extractNestedObjectLiteral } from "./config-
|
|
9
|
-
import { t as detectFramework } from "./utils-
|
|
10
|
-
import { n as inspectAgentCompactionState, o as scanDocsPageTargets } from "./codeblocks-
|
|
8
|
+
import { a as loadProjectEnv, c as readNavTitle, f as readTopLevelStringProperty, i as loadDocsConfigModule, m as resolveDocsContentDir, o as readBooleanProperty, p as resolveDocsConfigPath, r as extractTopLevelConfigObject, t as extractNestedObjectLiteral } from "./config-rHQQuz98.mjs";
|
|
9
|
+
import { t as detectFramework } from "./utils-CGlOADu1.mjs";
|
|
10
|
+
import { n as inspectAgentCompactionState, o as scanDocsPageTargets } from "./codeblocks-Vzf0AQNa.mjs";
|
|
11
11
|
import { existsSync, lstatSync, readFileSync, readdirSync } from "node:fs";
|
|
12
12
|
import path from "node:path";
|
|
13
13
|
import { LATEST_PROTOCOL_VERSION } from "@modelcontextprotocol/sdk/types.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as fileExists, o as exec, s as execOutput } from "./utils-
|
|
2
|
-
import { a as getPackagesForFramework, c as resolveDocsPackageManager, l as validateUpgradeVersion, r as buildDocsPackageInstallCommand, s as resolveDocsPackageFramework } from "./package-version-
|
|
1
|
+
import { c as fileExists, o as exec, s as execOutput } from "./utils-CGlOADu1.mjs";
|
|
2
|
+
import { a as getPackagesForFramework, c as resolveDocsPackageManager, l as validateUpgradeVersion, r as buildDocsPackageInstallCommand, s as resolveDocsPackageFramework } from "./package-version-DMFdOnyC.mjs";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import pc from "picocolors";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/cli/errors.ts
|
|
2
|
+
const CLI_ERROR_REPORTED_KEY = "__farmingLabsDocsCliErrorReported";
|
|
3
|
+
function formatCliError(error) {
|
|
4
|
+
if (error instanceof Error && error.message.trim()) return error.message.trim();
|
|
5
|
+
if (typeof error === "string" && error.trim()) return error.trim();
|
|
6
|
+
return "An unexpected error occurred.";
|
|
7
|
+
}
|
|
8
|
+
function markCliErrorReported(error) {
|
|
9
|
+
if (error && typeof error === "object") error[CLI_ERROR_REPORTED_KEY] = true;
|
|
10
|
+
}
|
|
11
|
+
function wasCliErrorReported(error) {
|
|
12
|
+
return Boolean(error && typeof error === "object" && error[CLI_ERROR_REPORTED_KEY] === true);
|
|
13
|
+
}
|
|
14
|
+
function shouldPrintStackTrace(env = process.env) {
|
|
15
|
+
const debug = env.DOCS_DEBUG ?? env.DEBUG;
|
|
16
|
+
return debug === "1" || debug === "true" || debug === "@farming-labs/docs";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { wasCliErrorReported as i, markCliErrorReported as n, shouldPrintStackTrace as r, formatCliError as t };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as DocsObservabilityEventInput, $t as SimpleDocsSearchConfig, A as DocsCloudApiKeyConfig, At as McpDocsSearchConfig, B as DocsCodeBlocksValidateConfig, Bt as PageFrontmatter, C as DocsAskAIActionData, Ct as FontStyle, D as DocsAskAIFeedbackMessage, Dt as LlmsTxtMaxCharsConfig, E as DocsAskAIFeedbackData, Et as LlmsTxtConfig, F as DocsCodeBlocksConfig, Ft as OpenDocsProviderId, G as DocsFeedbackValue, Gt as ResolvedDocsRelatedLink, H as DocsCodeBlocksValidationPolicy, Ht as PageSidebarFrontmatter, I as DocsCodeBlocksPlannerConfig, It as OpenDocsTarget, J as DocsMcpToolsConfig, Jt as SidebarFolderIndexBehavior, K as DocsI18nConfig, Kt as SidebarComponentProps, L as DocsCodeBlocksPlannerProvider, Lt as OpenGraphImage, M as DocsCloudFeatureConfig, Mt as OpenDocsConfig, N as DocsCloudPreviewConfig, Nt as OpenDocsProvider, O as DocsAskAIFeedbackValue, Ot as LlmsTxtMaxCharsMode, P as DocsCloudPublishConfig, Pt as OpenDocsProviderConfig, Q as DocsObservabilityEvent, Qt as SidebarTree, R as DocsCodeBlocksRunnerConfig, Rt as OrderingItem, S as DocsAnalyticsSource, St as FeedbackConfig, T as DocsAskAIFeedbackConfig, Tt as LastUpdatedConfig, U as DocsConfig, Ut as PageTwitter, V as DocsCodeBlocksValidationMode, Vt as PageOpenGraph, W as DocsFeedbackData, Wt as ReadingTimeConfig, X as DocsNav, Xt as SidebarNode, Y as DocsMetadata, Yt as SidebarFolderNode, Z as DocsObservabilityConfig, Zt as SidebarPageNode, _ as DocsAnalyticsConfig, _t as DocsSearchResult, a as ApiReferenceRenderer, at as DocsReviewScoreConfig, b as DocsAnalyticsEventType, bt as DocsSitemapConfig, c as ChangelogFrontmatter, ct as DocsRobotsRule, d as CustomDocsSearchConfig, dt as DocsSearchAdapterFactory, en as ThemeToggleConfig, et as DocsRelatedItem, f as DocsAgentFeedbackContext, ft as DocsSearchChunkingConfig, g as DocsAgentTraceStatus, gt as DocsSearchQuery, h as DocsAgentTraceEventType, ht as DocsSearchEmbeddingsConfig, i as ApiReferenceConfig, it as DocsReviewRulesConfig, j as DocsCloudConfig, jt as OGConfig, k as DocsAskAIMcpConfig, kt as LlmsTxtSectionConfig, l as CodeBlockCopyData, lt as DocsSearchAdapter, m as DocsAgentTraceEventInput, mt as DocsSearchDocument, n as AgentFeedbackConfig, nn as TypographyConfig, nt as DocsReviewCiMode, o as BreadcrumbConfig, ot as DocsReviewSeverity, p as DocsAgentFeedbackData, pt as DocsSearchConfig, q as DocsMcpConfig, qt as SidebarConfig, r as AlgoliaDocsSearchConfig, rn as UIConfig, rt as DocsReviewConfig, s as ChangelogConfig, st as DocsRobotsConfig, t as AIConfig, tn as TypesenseDocsSearchConfig, tt as DocsReviewCiConfig, u as CopyMarkdownConfig, ut as DocsSearchAdapterContext, v as DocsAnalyticsEvent, vt as DocsSearchResultType, w as DocsAskAIActionType, wt as GithubConfig, x as DocsAnalyticsInput, xt as DocsTheme, y as DocsAnalyticsEventInput, yt as DocsSearchSourcePage, z as DocsCodeBlocksRunnerProvider, zt as PageActionsConfig } from "./types-
|
|
2
|
-
import { $ as createDocsAgentTraceId, A as resolveDocsSitemapRequest, C as buildDocsSitemapManifest, D as renderDocsSitemapXml, E as renderDocsSitemapMarkdown, I as PromptAction, J as DOCS_AGENT_TRACE_EVENT_TYPES, L as PromptProviderChoice, O as resolveDocsSitemapConfig, Q as createDocsAgentTraceContext, R as SerializeOpenDocsProviderOptions, S as DocsSitemapResolvedConfig, T as readDocsSitemapManifestFromContentMap, X as ResolvedDocsAnalyticsConfig, Y as DocsAgentTraceContext, Z as ResolvedDocsObservabilityConfig, _ as DEFAULT_SITEMAP_XML_ROUTE, a as createMcpSearchAdapter, at as resolveDocsObservabilityConfig, b as DocsSitemapManifestPage, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, et as emitDocsAgentTraceEvent, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, h as DEFAULT_SITEMAP_MD_ROUTE, i as createCustomSearchAdapter, it as resolveDocsAnalyticsConfig, j as toDocsSitemapMarkdownUrl, k as resolveDocsSitemapPageLastmod, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_DOCS_ROUTE, n as buildDocsSearchDocuments, nt as emitDocsObservabilityEvent, o as createSimpleSearchAdapter, p as DEFAULT_SITEMAP_MANIFEST_PATH, r as createAlgoliaSearchAdapter, rt as getDocsRequestAnalyticsProperties, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, tt as emitDocsAnalyticsEvent, u as performDocsSearch, v as DocsSitemapFormat, w as createDocsSitemapResponse, x as DocsSitemapPageInput, y as DocsSitemapManifest, z as SerializedOpenDocsProvider } from "./search-
|
|
1
|
+
import { $ as DocsObservabilityEventInput, $t as SimpleDocsSearchConfig, A as DocsCloudApiKeyConfig, At as McpDocsSearchConfig, B as DocsCodeBlocksValidateConfig, Bt as PageFrontmatter, C as DocsAskAIActionData, Ct as FontStyle, D as DocsAskAIFeedbackMessage, Dt as LlmsTxtMaxCharsConfig, E as DocsAskAIFeedbackData, Et as LlmsTxtConfig, F as DocsCodeBlocksConfig, Ft as OpenDocsProviderId, G as DocsFeedbackValue, Gt as ResolvedDocsRelatedLink, H as DocsCodeBlocksValidationPolicy, Ht as PageSidebarFrontmatter, I as DocsCodeBlocksPlannerConfig, It as OpenDocsTarget, J as DocsMcpToolsConfig, Jt as SidebarFolderIndexBehavior, K as DocsI18nConfig, Kt as SidebarComponentProps, L as DocsCodeBlocksPlannerProvider, Lt as OpenGraphImage, M as DocsCloudFeatureConfig, Mt as OpenDocsConfig, N as DocsCloudPreviewConfig, Nt as OpenDocsProvider, O as DocsAskAIFeedbackValue, Ot as LlmsTxtMaxCharsMode, P as DocsCloudPublishConfig, Pt as OpenDocsProviderConfig, Q as DocsObservabilityEvent, Qt as SidebarTree, R as DocsCodeBlocksRunnerConfig, Rt as OrderingItem, S as DocsAnalyticsSource, St as FeedbackConfig, T as DocsAskAIFeedbackConfig, Tt as LastUpdatedConfig, U as DocsConfig, Ut as PageTwitter, V as DocsCodeBlocksValidationMode, Vt as PageOpenGraph, W as DocsFeedbackData, Wt as ReadingTimeConfig, X as DocsNav, Xt as SidebarNode, Y as DocsMetadata, Yt as SidebarFolderNode, Z as DocsObservabilityConfig, Zt as SidebarPageNode, _ as DocsAnalyticsConfig, _t as DocsSearchResult, a as ApiReferenceRenderer, at as DocsReviewScoreConfig, b as DocsAnalyticsEventType, bt as DocsSitemapConfig, c as ChangelogFrontmatter, ct as DocsRobotsRule, d as CustomDocsSearchConfig, dt as DocsSearchAdapterFactory, en as ThemeToggleConfig, et as DocsRelatedItem, f as DocsAgentFeedbackContext, ft as DocsSearchChunkingConfig, g as DocsAgentTraceStatus, gt as DocsSearchQuery, h as DocsAgentTraceEventType, ht as DocsSearchEmbeddingsConfig, i as ApiReferenceConfig, it as DocsReviewRulesConfig, j as DocsCloudConfig, jt as OGConfig, k as DocsAskAIMcpConfig, kt as LlmsTxtSectionConfig, l as CodeBlockCopyData, lt as DocsSearchAdapter, m as DocsAgentTraceEventInput, mt as DocsSearchDocument, n as AgentFeedbackConfig, nn as TypographyConfig, nt as DocsReviewCiMode, o as BreadcrumbConfig, ot as DocsReviewSeverity, p as DocsAgentFeedbackData, pt as DocsSearchConfig, q as DocsMcpConfig, qt as SidebarConfig, r as AlgoliaDocsSearchConfig, rn as UIConfig, rt as DocsReviewConfig, s as ChangelogConfig, st as DocsRobotsConfig, t as AIConfig, tn as TypesenseDocsSearchConfig, tt as DocsReviewCiConfig, u as CopyMarkdownConfig, ut as DocsSearchAdapterContext, v as DocsAnalyticsEvent, vt as DocsSearchResultType, w as DocsAskAIActionType, wt as GithubConfig, x as DocsAnalyticsInput, xt as DocsTheme, y as DocsAnalyticsEventInput, yt as DocsSearchSourcePage, z as DocsCodeBlocksRunnerProvider, zt as PageActionsConfig } from "./types-CwsXQ_v1.mjs";
|
|
2
|
+
import { $ as createDocsAgentTraceId, A as resolveDocsSitemapRequest, C as buildDocsSitemapManifest, D as renderDocsSitemapXml, E as renderDocsSitemapMarkdown, I as PromptAction, J as DOCS_AGENT_TRACE_EVENT_TYPES, L as PromptProviderChoice, O as resolveDocsSitemapConfig, Q as createDocsAgentTraceContext, R as SerializeOpenDocsProviderOptions, S as DocsSitemapResolvedConfig, T as readDocsSitemapManifestFromContentMap, X as ResolvedDocsAnalyticsConfig, Y as DocsAgentTraceContext, Z as ResolvedDocsObservabilityConfig, _ as DEFAULT_SITEMAP_XML_ROUTE, a as createMcpSearchAdapter, at as resolveDocsObservabilityConfig, b as DocsSitemapManifestPage, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, et as emitDocsAgentTraceEvent, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, h as DEFAULT_SITEMAP_MD_ROUTE, i as createCustomSearchAdapter, it as resolveDocsAnalyticsConfig, j as toDocsSitemapMarkdownUrl, k as resolveDocsSitemapPageLastmod, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_DOCS_ROUTE, n as buildDocsSearchDocuments, nt as emitDocsObservabilityEvent, o as createSimpleSearchAdapter, p as DEFAULT_SITEMAP_MANIFEST_PATH, r as createAlgoliaSearchAdapter, rt as getDocsRequestAnalyticsProperties, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, tt as emitDocsAnalyticsEvent, u as performDocsSearch, v as DocsSitemapFormat, w as createDocsSitemapResponse, x as DocsSitemapPageInput, y as DocsSitemapManifest, z as SerializedOpenDocsProvider } from "./search-MyKnoCrX.mjs";
|
|
3
3
|
import { DocsMcpPage, DocsMcpResolvedConfig } from "./mcp.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/define-docs.d.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as devInstallCommand, c as fileExists, d as spawnAndWaitFor, f as writeFileSafe, i as detectPackageManagerFromLockfile, l as installCommand, n as detectGlobalCssFiles, o as exec, r as detectNextAppDir, t as detectFramework, u as readFileSafe } from "./utils-
|
|
2
|
-
import { $ as svelteDocsPublicHookTemplate, A as nextConfigMergedTemplate, B as nuxtServerApiDocsRouteTemplate, C as injectRootProviderIntoLayout, D as injectTanstackVitePlugins, E as injectTanstackRootProviderIntoRoute, F as nuxtDocsConfigTemplate, G as quickstartPageTemplate, H as nuxtServerDocsPublicMiddlewareTemplate, I as nuxtDocsPageTemplate, J as svelteDocsApiRouteTemplate, K as rootLayoutTemplate, L as nuxtGlobalCssTemplate, M as nextLocaleDocPageTemplate, N as nextLocalizedPageTemplate, O as installationPageTemplate, P as nuxtConfigTemplate, Q as svelteDocsPageTemplate, R as nuxtInstallationPageTemplate, S as injectNuxtCssImport, T as injectSvelteDocsPublicHook, U as nuxtWelcomePageTemplate, V as nuxtServerApiReferenceRouteTemplate, W as postcssConfigTemplate, X as svelteDocsLayoutServerTemplate, Y as svelteDocsConfigTemplate, Z as svelteDocsLayoutTemplate, _ as getAstroAdapterPkg, _t as tanstackViteConfigTemplate, a as astroDocsIndexTemplate, at as svelteWelcomePageTemplate, b as injectAstroDocsMiddleware, bt as welcomePageTemplate, c as astroDocsServerTemplate, ct as tanstackDocsCatchAllRouteTemplate, d as astroQuickstartPageTemplate, dt as tanstackDocsIndexRouteTemplate, et as svelteDocsServerTemplate, f as astroWelcomePageTemplate, ft as tanstackDocsPublicRouteTemplate, g as docsLayoutTemplate, gt as tanstackRootRouteTemplate, h as docsConfigTemplate, ht as tanstackQuickstartPageTemplate, i as astroDocsConfigTemplate, it as svelteRootLayoutTemplate, j as nextConfigTemplate, k as nextApiReferencePageTemplate, l as astroGlobalCssTemplate, lt as tanstackDocsConfigTemplate, m as customThemeTsTemplate, mt as tanstackInstallationPageTemplate, n as astroApiRouteTemplate, nt as svelteInstallationPageTemplate, o as astroDocsMiddlewareTemplate, ot as tanstackApiDocsRouteTemplate, p as customThemeCssTemplate, pt as tanstackDocsServerTemplate, q as svelteApiReferenceRouteTemplate, r as astroConfigTemplate, rt as svelteQuickstartPageTemplate, s as astroDocsPageTemplate, st as tanstackApiReferenceRouteTemplate, t as astroApiReferenceRouteTemplate, tt as svelteGlobalCssTemplate, u as astroInstallationPageTemplate, ut as tanstackDocsFunctionsTemplate, v as globalCssTemplate, vt as tanstackWelcomePageTemplate, w as injectSvelteCssImport, x as injectCssImport, y as injectAstroCssImport, yt as tsconfigTemplate, z as nuxtQuickstartPageTemplate } from "./templates-
|
|
1
|
+
import { a as devInstallCommand, c as fileExists, d as spawnAndWaitFor, f as writeFileSafe, i as detectPackageManagerFromLockfile, l as installCommand, n as detectGlobalCssFiles, o as exec, r as detectNextAppDir, t as detectFramework, u as readFileSafe } from "./utils-CGlOADu1.mjs";
|
|
2
|
+
import { $ as svelteDocsPublicHookTemplate, A as nextConfigMergedTemplate, B as nuxtServerApiDocsRouteTemplate, C as injectRootProviderIntoLayout, D as injectTanstackVitePlugins, E as injectTanstackRootProviderIntoRoute, F as nuxtDocsConfigTemplate, G as quickstartPageTemplate, H as nuxtServerDocsPublicMiddlewareTemplate, I as nuxtDocsPageTemplate, J as svelteDocsApiRouteTemplate, K as rootLayoutTemplate, L as nuxtGlobalCssTemplate, M as nextLocaleDocPageTemplate, N as nextLocalizedPageTemplate, O as installationPageTemplate, P as nuxtConfigTemplate, Q as svelteDocsPageTemplate, R as nuxtInstallationPageTemplate, S as injectNuxtCssImport, T as injectSvelteDocsPublicHook, U as nuxtWelcomePageTemplate, V as nuxtServerApiReferenceRouteTemplate, W as postcssConfigTemplate, X as svelteDocsLayoutServerTemplate, Y as svelteDocsConfigTemplate, Z as svelteDocsLayoutTemplate, _ as getAstroAdapterPkg, _t as tanstackViteConfigTemplate, a as astroDocsIndexTemplate, at as svelteWelcomePageTemplate, b as injectAstroDocsMiddleware, bt as welcomePageTemplate, c as astroDocsServerTemplate, ct as tanstackDocsCatchAllRouteTemplate, d as astroQuickstartPageTemplate, dt as tanstackDocsIndexRouteTemplate, et as svelteDocsServerTemplate, f as astroWelcomePageTemplate, ft as tanstackDocsPublicRouteTemplate, g as docsLayoutTemplate, gt as tanstackRootRouteTemplate, h as docsConfigTemplate, ht as tanstackQuickstartPageTemplate, i as astroDocsConfigTemplate, it as svelteRootLayoutTemplate, j as nextConfigTemplate, k as nextApiReferencePageTemplate, l as astroGlobalCssTemplate, lt as tanstackDocsConfigTemplate, m as customThemeTsTemplate, mt as tanstackInstallationPageTemplate, n as astroApiRouteTemplate, nt as svelteInstallationPageTemplate, o as astroDocsMiddlewareTemplate, ot as tanstackApiDocsRouteTemplate, p as customThemeCssTemplate, pt as tanstackDocsServerTemplate, q as svelteApiReferenceRouteTemplate, r as astroConfigTemplate, rt as svelteQuickstartPageTemplate, s as astroDocsPageTemplate, st as tanstackApiReferenceRouteTemplate, t as astroApiReferenceRouteTemplate, tt as svelteGlobalCssTemplate, u as astroInstallationPageTemplate, ut as tanstackDocsFunctionsTemplate, v as globalCssTemplate, vt as tanstackWelcomePageTemplate, w as injectSvelteCssImport, x as injectCssImport, y as injectAstroCssImport, yt as tsconfigTemplate, z as nuxtQuickstartPageTemplate } from "./templates-JtyB8x53.mjs";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import pc from "picocolors";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./sitemap-server-idLUrmmU.mjs";
|
|
2
2
|
import { createFilesystemDocsMcpSource, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
3
3
|
import "./server.mjs";
|
|
4
|
-
import { c as readNavTitle, m as resolveDocsContentDir, n as extractObjectLiteral, o as readBooleanProperty, p as resolveDocsConfigPath, u as readStringProperty } from "./config-
|
|
4
|
+
import { c as readNavTitle, m as resolveDocsContentDir, n as extractObjectLiteral, o as readBooleanProperty, p as resolveDocsConfigPath, u as readStringProperty } from "./config-rHQQuz98.mjs";
|
|
5
5
|
import { readFileSync } from "node:fs";
|
|
6
6
|
|
|
7
7
|
//#region src/cli/mcp.ts
|
package/dist/mcp.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Rt as OrderingItem, Z as DocsObservabilityConfig, _ as DocsAnalyticsConfig, pt as DocsSearchConfig, q as DocsMcpConfig, yt as DocsSearchSourcePage } from "./types-
|
|
1
|
+
import { Rt as OrderingItem, Z as DocsObservabilityConfig, _ as DocsAnalyticsConfig, pt as DocsSearchConfig, q as DocsMcpConfig, yt as DocsSearchSourcePage } from "./types-CwsXQ_v1.mjs";
|
|
2
2
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
3
|
|
|
4
4
|
//#region src/mcp.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as detectPackageManagerFromLockfile, l as installCommand, t as detectFramework } from "./utils-
|
|
1
|
+
import { i as detectPackageManagerFromLockfile, l as installCommand, t as detectFramework } from "./utils-CGlOADu1.mjs";
|
|
2
2
|
import pc from "picocolors";
|
|
3
3
|
import * as p from "@clack/prompts";
|
|
4
4
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as ensureDocsReviewWorkflow, o as readDocsReviewConfigFromSource, s as resolveDocsReviewConfig } from "./review-B7goPYUb.mjs";
|
|
2
|
-
import { f as readTopLevelStringProperty, i as loadDocsConfigModule, m as resolveDocsContentDir, p as resolveDocsConfigPath } from "./config-
|
|
2
|
+
import { f as readTopLevelStringProperty, i as loadDocsConfigModule, m as resolveDocsContentDir, p as resolveDocsConfigPath } from "./config-rHQQuz98.mjs";
|
|
3
3
|
import matter from "gray-matter";
|
|
4
4
|
import { existsSync, lstatSync, readFileSync, readdirSync } from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./agent-B7T4gauS.mjs";
|
|
2
2
|
import { c as renderDocsRobotsGeneratedBlock, f as upsertDocsRobotsGeneratedBlock, i as DOCS_ROBOTS_GENERATED_BLOCK_START, r as DOCS_ROBOTS_GENERATED_BLOCK_END, u as resolveDocsRobotsConfig } from "./robots-CDdD2o-Q.mjs";
|
|
3
|
-
import { f as readTopLevelStringProperty, i as loadDocsConfigModule, o as readBooleanProperty, p as resolveDocsConfigPath, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-
|
|
4
|
-
import { t as detectFramework } from "./utils-
|
|
3
|
+
import { f as readTopLevelStringProperty, i as loadDocsConfigModule, o as readBooleanProperty, p as resolveDocsConfigPath, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-rHQQuz98.mjs";
|
|
4
|
+
import { t as detectFramework } from "./utils-CGlOADu1.mjs";
|
|
5
5
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import pc from "picocolors";
|
|
@@ -2,7 +2,7 @@ import { n as buildDocsSearchDocuments, r as createAlgoliaSearchAdapter, s as cr
|
|
|
2
2
|
import "./sitemap-server-idLUrmmU.mjs";
|
|
3
3
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
4
4
|
import "./server.mjs";
|
|
5
|
-
import { a as loadProjectEnv, f as readTopLevelStringProperty, m as resolveDocsContentDir, p as resolveDocsConfigPath } from "./config-
|
|
5
|
+
import { a as loadProjectEnv, f as readTopLevelStringProperty, m as resolveDocsContentDir, p as resolveDocsConfigPath } from "./config-rHQQuz98.mjs";
|
|
6
6
|
import { readFileSync } from "node:fs";
|
|
7
7
|
import pc from "picocolors";
|
|
8
8
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as DocsObservabilityEventInput, At as McpDocsSearchConfig, Gt as ResolvedDocsRelatedLink, It as OpenDocsTarget, Nt as OpenDocsProvider, Q as DocsObservabilityEvent, Z as DocsObservabilityConfig, _ as DocsAnalyticsConfig, _t as DocsSearchResult, bt as DocsSitemapConfig, d as CustomDocsSearchConfig, dt as DocsSearchAdapterFactory, ft as DocsSearchChunkingConfig, k as DocsAskAIMcpConfig, lt as DocsSearchAdapter, m as DocsAgentTraceEventInput, mt as DocsSearchDocument, pt as DocsSearchConfig, r as AlgoliaDocsSearchConfig, tn as TypesenseDocsSearchConfig, v as DocsAnalyticsEvent, y as DocsAnalyticsEventInput, yt as DocsSearchSourcePage } from "./types-
|
|
1
|
+
import { $ as DocsObservabilityEventInput, At as McpDocsSearchConfig, Gt as ResolvedDocsRelatedLink, It as OpenDocsTarget, Nt as OpenDocsProvider, Q as DocsObservabilityEvent, Z as DocsObservabilityConfig, _ as DocsAnalyticsConfig, _t as DocsSearchResult, bt as DocsSitemapConfig, d as CustomDocsSearchConfig, dt as DocsSearchAdapterFactory, ft as DocsSearchChunkingConfig, k as DocsAskAIMcpConfig, lt as DocsSearchAdapter, m as DocsAgentTraceEventInput, mt as DocsSearchDocument, pt as DocsSearchConfig, r as AlgoliaDocsSearchConfig, tn as TypesenseDocsSearchConfig, v as DocsAnalyticsEvent, y as DocsAnalyticsEventInput, yt as DocsSearchSourcePage } from "./types-CwsXQ_v1.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/analytics.d.ts
|
|
4
4
|
declare const DOCS_AGENT_TRACE_EVENT_TYPES: readonly ["run.start", "run.end", "run.error", "user.input", "prompt.build", "retrieval.query", "retrieval.result", "retrieval.error", "model.call", "model.response", "model.stream", "model.error", "tool.call", "tool.result", "tool.error", "retry", "timeout", "error", "agent.final"];
|
package/dist/server.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as DocsObservabilityEventInput, At as McpDocsSearchConfig, D as DocsAskAIFeedbackMessage, E as DocsAskAIFeedbackData, O as DocsAskAIFeedbackValue, Q as DocsObservabilityEvent, T as DocsAskAIFeedbackConfig, U as DocsConfig, Z as DocsObservabilityConfig, _ as DocsAnalyticsConfig, _t as DocsSearchResult, a as ApiReferenceRenderer, bt as DocsSitemapConfig, dt as DocsSearchAdapterFactory, g as DocsAgentTraceStatus, gt as DocsSearchQuery, h as DocsAgentTraceEventType, it as DocsReviewRulesConfig, k as DocsAskAIMcpConfig, lt as DocsSearchAdapter, m as DocsAgentTraceEventInput, mt as DocsSearchDocument, nt as DocsReviewCiMode, pt as DocsSearchConfig, rt as DocsReviewConfig, ut as DocsSearchAdapterContext, v as DocsAnalyticsEvent, y as DocsAnalyticsEventInput, yt as DocsSearchSourcePage } from "./types-
|
|
2
|
-
import { $ as createDocsAgentTraceId, A as resolveDocsSitemapRequest, B as normalizePromptProviderName, C as buildDocsSitemapManifest, D as renderDocsSitemapXml, E as renderDocsSitemapMarkdown, F as DEFAULT_PROMPT_PROVIDER_TEMPLATES, G as serializeDocsIconRegistry, H as resolvePromptProviderChoices, I as PromptAction, J as DOCS_AGENT_TRACE_EVENT_TYPES, K as serializeOpenDocsProvider, L as PromptProviderChoice, M as DEFAULT_OPEN_DOCS_PROMPT, N as DEFAULT_OPEN_DOCS_PROVIDER_IDS, O as resolveDocsSitemapConfig, P as DEFAULT_OPEN_DOCS_TARGET, Q as createDocsAgentTraceContext, R as SerializeOpenDocsProviderOptions, S as DocsSitemapResolvedConfig, T as readDocsSitemapManifestFromContentMap, U as sanitizePromptText, V as parsePromptStringArray, W as serializeDocsIcon, X as ResolvedDocsAnalyticsConfig, Y as DocsAgentTraceContext, Z as ResolvedDocsObservabilityConfig, _ as DEFAULT_SITEMAP_XML_ROUTE, a as createMcpSearchAdapter, at as resolveDocsObservabilityConfig, b as DocsSitemapManifestPage, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, et as emitDocsAgentTraceEvent, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, h as DEFAULT_SITEMAP_MD_ROUTE, i as createCustomSearchAdapter, it as resolveDocsAnalyticsConfig, j as toDocsSitemapMarkdownUrl, k as resolveDocsSitemapPageLastmod, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_DOCS_ROUTE, n as buildDocsSearchDocuments, nt as emitDocsObservabilityEvent, o as createSimpleSearchAdapter, p as DEFAULT_SITEMAP_MANIFEST_PATH, q as serializeOpenDocsProviders, r as createAlgoliaSearchAdapter, rt as getDocsRequestAnalyticsProperties, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, tt as emitDocsAnalyticsEvent, u as performDocsSearch, v as DocsSitemapFormat, w as createDocsSitemapResponse, x as DocsSitemapPageInput, y as DocsSitemapManifest, z as SerializedOpenDocsProvider } from "./search-
|
|
1
|
+
import { $ as DocsObservabilityEventInput, At as McpDocsSearchConfig, D as DocsAskAIFeedbackMessage, E as DocsAskAIFeedbackData, O as DocsAskAIFeedbackValue, Q as DocsObservabilityEvent, T as DocsAskAIFeedbackConfig, U as DocsConfig, Z as DocsObservabilityConfig, _ as DocsAnalyticsConfig, _t as DocsSearchResult, a as ApiReferenceRenderer, bt as DocsSitemapConfig, dt as DocsSearchAdapterFactory, g as DocsAgentTraceStatus, gt as DocsSearchQuery, h as DocsAgentTraceEventType, it as DocsReviewRulesConfig, k as DocsAskAIMcpConfig, lt as DocsSearchAdapter, m as DocsAgentTraceEventInput, mt as DocsSearchDocument, nt as DocsReviewCiMode, pt as DocsSearchConfig, rt as DocsReviewConfig, ut as DocsSearchAdapterContext, v as DocsAnalyticsEvent, y as DocsAnalyticsEventInput, yt as DocsSearchSourcePage } from "./types-CwsXQ_v1.mjs";
|
|
2
|
+
import { $ as createDocsAgentTraceId, A as resolveDocsSitemapRequest, B as normalizePromptProviderName, C as buildDocsSitemapManifest, D as renderDocsSitemapXml, E as renderDocsSitemapMarkdown, F as DEFAULT_PROMPT_PROVIDER_TEMPLATES, G as serializeDocsIconRegistry, H as resolvePromptProviderChoices, I as PromptAction, J as DOCS_AGENT_TRACE_EVENT_TYPES, K as serializeOpenDocsProvider, L as PromptProviderChoice, M as DEFAULT_OPEN_DOCS_PROMPT, N as DEFAULT_OPEN_DOCS_PROVIDER_IDS, O as resolveDocsSitemapConfig, P as DEFAULT_OPEN_DOCS_TARGET, Q as createDocsAgentTraceContext, R as SerializeOpenDocsProviderOptions, S as DocsSitemapResolvedConfig, T as readDocsSitemapManifestFromContentMap, U as sanitizePromptText, V as parsePromptStringArray, W as serializeDocsIcon, X as ResolvedDocsAnalyticsConfig, Y as DocsAgentTraceContext, Z as ResolvedDocsObservabilityConfig, _ as DEFAULT_SITEMAP_XML_ROUTE, a as createMcpSearchAdapter, at as resolveDocsObservabilityConfig, b as DocsSitemapManifestPage, c as formatDocsAskAIPackageHints, d as resolveAskAISearchRequestConfig, et as emitDocsAgentTraceEvent, f as resolveSearchRequestConfig, g as DEFAULT_SITEMAP_MD_WELL_KNOWN_ROUTE, h as DEFAULT_SITEMAP_MD_ROUTE, i as createCustomSearchAdapter, it as resolveDocsAnalyticsConfig, j as toDocsSitemapMarkdownUrl, k as resolveDocsSitemapPageLastmod, l as inferDocsAskAIPackageHints, m as DEFAULT_SITEMAP_MD_DOCS_ROUTE, n as buildDocsSearchDocuments, nt as emitDocsObservabilityEvent, o as createSimpleSearchAdapter, p as DEFAULT_SITEMAP_MANIFEST_PATH, q as serializeOpenDocsProviders, r as createAlgoliaSearchAdapter, rt as getDocsRequestAnalyticsProperties, s as createTypesenseSearchAdapter, t as buildDocsAskAIContext, tt as emitDocsAnalyticsEvent, u as performDocsSearch, v as DocsSitemapFormat, w as createDocsSitemapResponse, x as DocsSitemapPageInput, y as DocsSitemapManifest, z as SerializedOpenDocsProvider } from "./search-MyKnoCrX.mjs";
|
|
3
3
|
import { DocsMcpCodeExample, DocsMcpConfigSchema, DocsMcpConfigSchemaOption, DocsMcpDocsList, DocsMcpDocsPageSummary, DocsMcpDocsSection, DocsMcpHttpHandlers, DocsMcpNavigationNode, DocsMcpNavigationTree, DocsMcpPage, DocsMcpResolvedConfig, DocsMcpSource, createDocsMcpHttpHandler, createDocsMcpServer, createFilesystemDocsMcpSource, normalizeDocsMcpRoute, resolveDocsMcpConfig, runDocsMcpStdio } from "./mcp.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/code-group-mdx.d.ts
|
|
@@ -2,8 +2,8 @@ import { d as resolveDocsSitemapConfig, l as renderDocsSitemapMarkdown, o as bui
|
|
|
2
2
|
import "./sitemap-server-idLUrmmU.mjs";
|
|
3
3
|
import { createFilesystemDocsMcpSource } from "./mcp.mjs";
|
|
4
4
|
import "./server.mjs";
|
|
5
|
-
import { c as readNavTitle, f as readTopLevelStringProperty, i as loadDocsConfigModule, m as resolveDocsContentDir, o as readBooleanProperty, p as resolveDocsConfigPath, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-
|
|
6
|
-
import { t as detectFramework } from "./utils-
|
|
5
|
+
import { c as readNavTitle, f as readTopLevelStringProperty, i as loadDocsConfigModule, m as resolveDocsContentDir, o as readBooleanProperty, p as resolveDocsConfigPath, t as extractNestedObjectLiteral, u as readStringProperty } from "./config-rHQQuz98.mjs";
|
|
6
|
+
import { t as detectFramework } from "./utils-CGlOADu1.mjs";
|
|
7
7
|
import { existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import pc from "picocolors";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as fileExists, o as exec } from "./utils-
|
|
2
|
-
import { a as getPackagesForFramework, c as resolveDocsPackageManager, i as frameworkFromPreset, l as validateUpgradeVersion, n as PRESETS, o as presetFromFramework, r as buildDocsPackageInstallCommand, s as resolveDocsPackageFramework, t as PACKAGES_BY_FRAMEWORK } from "./package-version-
|
|
1
|
+
import { c as fileExists, o as exec } from "./utils-CGlOADu1.mjs";
|
|
2
|
+
import { a as getPackagesForFramework, c as resolveDocsPackageManager, i as frameworkFromPreset, l as validateUpgradeVersion, n as PRESETS, o as presetFromFramework, r as buildDocsPackageInstallCommand, s as resolveDocsPackageFramework, t as PACKAGES_BY_FRAMEWORK } from "./package-version-DMFdOnyC.mjs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import pc from "picocolors";
|
|
5
5
|
import * as p from "@clack/prompts";
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|