@farming-labs/docs 0.2.61 → 0.2.62

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.
Files changed (58) hide show
  1. package/package.json +1 -1
  2. package/dist/agent-DFHlw_JC.mjs +0 -624
  3. package/dist/agent-Fl0pjVNF.mjs +0 -4352
  4. package/dist/agent-evals-f4_OL10T.mjs +0 -2144
  5. package/dist/agent-export-D0zQhasD.mjs +0 -910
  6. package/dist/agent-scope-C_U--OZ7.mjs +0 -283
  7. package/dist/agent-skills-bundle.d.mts +0 -13
  8. package/dist/agent-skills-bundle.mjs +0 -12
  9. package/dist/agent-skills-server-CIeBszxp.mjs +0 -263
  10. package/dist/agent-skills-server-CKq3_jMj.d.mts +0 -12
  11. package/dist/agent-skills-vite.d.mts +0 -31
  12. package/dist/agent-skills-vite.mjs +0 -70
  13. package/dist/agents-ibnXrWyp.mjs +0 -221
  14. package/dist/analytics-Bx44lg6d.mjs +0 -177
  15. package/dist/cli/index.d.mts +0 -15
  16. package/dist/cli/index.mjs +0 -452
  17. package/dist/client/react.d.mts +0 -45
  18. package/dist/client/react.mjs +0 -223
  19. package/dist/cloud-analytics-CSyFE6SS.mjs +0 -132
  20. package/dist/cloud-ask-ai-D7ZgF47y.d.mts +0 -23
  21. package/dist/cloud-ask-ai-sbpjOR2K.mjs +0 -382
  22. package/dist/cloud-pdNC-tyj.mjs +0 -1615
  23. package/dist/code-blocks-DnNVNK2M.mjs +0 -871
  24. package/dist/codeblocks-CFuurVIH.mjs +0 -250
  25. package/dist/config-Wcdj-D0a.mjs +0 -369
  26. package/dist/dev-Cmy6DtdF.mjs +0 -1333
  27. package/dist/docs-cloud-server.d.mts +0 -70
  28. package/dist/docs-cloud-server.mjs +0 -310
  29. package/dist/doctor-CXostbsI.mjs +0 -2036
  30. package/dist/downgrade-w7e6Se0L.mjs +0 -184
  31. package/dist/errors-DbOhkE1h.mjs +0 -20
  32. package/dist/golden-evaluations-CBZ_JZjf.mjs +0 -1498
  33. package/dist/i18n-CCaFUnAN.mjs +0 -40
  34. package/dist/index.d.mts +0 -1141
  35. package/dist/index.mjs +0 -10
  36. package/dist/init-CQY0Woe3.mjs +0 -1264
  37. package/dist/mcp-DyPcoLwm.mjs +0 -156
  38. package/dist/mcp.d.mts +0 -298
  39. package/dist/mcp.mjs +0 -4426
  40. package/dist/metadata-Dv1ah0Aj.mjs +0 -237
  41. package/dist/package-version-n5AFur8a.mjs +0 -128
  42. package/dist/reading-time-C-SAhQT9.mjs +0 -742
  43. package/dist/review-D2UBrxFq.mjs +0 -673
  44. package/dist/robots-5Yqz9mz7.mjs +0 -179
  45. package/dist/robots-C08kDLsz.mjs +0 -201
  46. package/dist/search-9OnMGMvt.mjs +0 -1758
  47. package/dist/search-C6heDO8h.d.mts +0 -274
  48. package/dist/search-CNsRpz90.mjs +0 -104
  49. package/dist/server.d.mts +0 -342
  50. package/dist/server.mjs +0 -13
  51. package/dist/sitemap-BpYnSsfJ.mjs +0 -249
  52. package/dist/sitemap-server-D_0Kzanj.mjs +0 -1137
  53. package/dist/standards-discovery-C4HUqMd2.d.mts +0 -227
  54. package/dist/standards-discovery-C54V_aJH.mjs +0 -510
  55. package/dist/templates-Bq_P7ctv.mjs +0 -2465
  56. package/dist/types-EhFhYGfr.d.mts +0 -3305
  57. package/dist/upgrade-oz-GChgt.mjs +0 -56
  58. package/dist/utils-DpiIioYb.mjs +0 -225
@@ -1,184 +0,0 @@
1
- import { c as fileExists, o as exec, s as execOutput } from "./utils-DpiIioYb.mjs";
2
- import { a as getPackagesForFramework, c as resolveDocsPackageManager, l as validateUpgradeVersion, r as buildDocsPackageInstallCommand, s as resolveDocsPackageFramework } from "./package-version-n5AFur8a.mjs";
3
- import fs from "node:fs";
4
- import path from "node:path";
5
- import pc from "picocolors";
6
- import * as p from "@clack/prompts";
7
-
8
- //#region src/cli/downgrade.ts
9
- /**
10
- * Downgrade @farming-labs/* packages to a lower exact version.
11
- * Detects framework from package.json by default, or use --framework (next, tanstack-start, nuxt, sveltekit, astro).
12
- */
13
- function parseSemver(version) {
14
- const normalized = validateUpgradeVersion(version).split("+", 1)[0] ?? version;
15
- const prereleaseIndex = normalized.indexOf("-");
16
- const core = prereleaseIndex === -1 ? normalized : normalized.slice(0, prereleaseIndex);
17
- const prerelease = prereleaseIndex === -1 ? "" : normalized.slice(prereleaseIndex + 1);
18
- const [major = "0", minor = "0", patch = "0"] = core.split(".");
19
- return {
20
- major: Number.parseInt(major, 10),
21
- minor: Number.parseInt(minor, 10),
22
- patch: Number.parseInt(patch, 10),
23
- prerelease: prerelease ? prerelease.split(".") : []
24
- };
25
- }
26
- function comparePrereleaseIdentifier(a, b) {
27
- const aNumber = /^\d+$/.test(a) ? Number.parseInt(a, 10) : null;
28
- const bNumber = /^\d+$/.test(b) ? Number.parseInt(b, 10) : null;
29
- if (aNumber !== null && bNumber !== null) return Math.sign(aNumber - bNumber);
30
- if (aNumber !== null) return -1;
31
- if (bNumber !== null) return 1;
32
- return a.localeCompare(b);
33
- }
34
- function compareSemver(a, b) {
35
- const left = parseSemver(a);
36
- const right = parseSemver(b);
37
- for (const key of [
38
- "major",
39
- "minor",
40
- "patch"
41
- ]) if (left[key] !== right[key]) return Math.sign(left[key] - right[key]);
42
- if (left.prerelease.length === 0 && right.prerelease.length === 0) return 0;
43
- if (left.prerelease.length === 0) return 1;
44
- if (right.prerelease.length === 0) return -1;
45
- const length = Math.max(left.prerelease.length, right.prerelease.length);
46
- for (let index = 0; index < length; index++) {
47
- const leftPart = left.prerelease[index];
48
- const rightPart = right.prerelease[index];
49
- if (leftPart === void 0) return -1;
50
- if (rightPart === void 0) return 1;
51
- const compared = comparePrereleaseIdentifier(leftPart, rightPart);
52
- if (compared !== 0) return compared;
53
- }
54
- return 0;
55
- }
56
- function normalizeMaybeVersion(value) {
57
- try {
58
- return validateUpgradeVersion(value);
59
- } catch {
60
- return null;
61
- }
62
- }
63
- function extractVersionFromSpec(spec) {
64
- const exact = normalizeMaybeVersion(spec);
65
- if (exact) return exact;
66
- const rangeMatch = spec.match(/^[~^]([^~^<>=|\s]+)/);
67
- if (!rangeMatch) return null;
68
- return normalizeMaybeVersion(rangeMatch[1] ?? "");
69
- }
70
- function readJsonFile(filePath) {
71
- try {
72
- return JSON.parse(fs.readFileSync(filePath, "utf-8"));
73
- } catch {
74
- return null;
75
- }
76
- }
77
- function packageJsonPath(cwd, packageName) {
78
- return path.join(cwd, "node_modules", ...packageName.split("/"), "package.json");
79
- }
80
- function readCurrentPackageVersion(cwd, packageNames) {
81
- for (const packageName of packageNames) {
82
- const installedPackageJson = readJsonFile(packageJsonPath(cwd, packageName));
83
- const installedVersion = typeof installedPackageJson?.version === "string" ? normalizeMaybeVersion(installedPackageJson.version) : null;
84
- if (installedVersion) return installedVersion;
85
- }
86
- const projectPackageJson = readJsonFile(path.join(cwd, "package.json"));
87
- const dependencyGroups = [
88
- projectPackageJson?.dependencies,
89
- projectPackageJson?.devDependencies,
90
- projectPackageJson?.peerDependencies
91
- ];
92
- for (const group of dependencyGroups) {
93
- if (!group || typeof group !== "object") continue;
94
- for (const packageName of packageNames) {
95
- const spec = group[packageName];
96
- if (typeof spec !== "string") continue;
97
- const version = extractVersionFromSpec(spec);
98
- if (version) return version;
99
- }
100
- }
101
- return null;
102
- }
103
- function parsePublishedVersions(raw) {
104
- const parsed = JSON.parse(raw);
105
- return (Array.isArray(parsed) ? parsed : [parsed]).filter((version) => typeof version === "string").map((version) => normalizeMaybeVersion(version)).filter((version) => version !== null);
106
- }
107
- function getPreviousVersion(versions, currentVersion) {
108
- const current = validateUpgradeVersion(currentVersion);
109
- return versions.filter((version) => compareSemver(version, current) < 0).sort(compareSemver).at(-1) ?? null;
110
- }
111
- function fetchPublishedVersions(cwd) {
112
- return parsePublishedVersions(execOutput("npm view @farming-labs/docs versions --json", cwd));
113
- }
114
- function buildDowngradeCommand(framework, version, pm) {
115
- return buildDocsPackageInstallCommand(framework, validateUpgradeVersion(version), pm);
116
- }
117
- async function downgrade(options = {}) {
118
- const cwd = process.cwd();
119
- p.intro(pc.bgCyan(pc.black(" @farming-labs/docs downgrade ")));
120
- if (!fileExists(path.join(cwd, "package.json"))) {
121
- p.log.error("No package.json found in the current directory. Run this from your project root.");
122
- process.exit(1);
123
- }
124
- const { framework, preset } = resolveDocsPackageFramework(cwd, options.framework);
125
- const packages = getPackagesForFramework(framework);
126
- const currentVersion = readCurrentPackageVersion(cwd, packages);
127
- if (!currentVersion) {
128
- p.log.error("Could not determine the current @farming-labs docs package version. Install dependencies first or use an exact package version in package.json.");
129
- process.exit(1);
130
- }
131
- let targetVersion;
132
- if (options.version !== void 0) {
133
- try {
134
- targetVersion = validateUpgradeVersion(options.version);
135
- } catch (error) {
136
- p.log.error(error instanceof Error ? error.message : "Invalid downgrade version.");
137
- process.exit(1);
138
- }
139
- const comparison = compareSemver(targetVersion, currentVersion);
140
- if (comparison > 0) {
141
- p.log.error(`Version ${pc.cyan(targetVersion)} is newer than current ${pc.cyan(currentVersion)}.`);
142
- p.log.info(`Use ${pc.cyan(`docs upgrade --version ${targetVersion}`)} instead.`);
143
- process.exit(1);
144
- }
145
- if (comparison === 0) {
146
- p.log.error(`Version ${pc.cyan(targetVersion)} is already installed. Choose a lower version to downgrade.`);
147
- process.exit(1);
148
- }
149
- } else {
150
- let publishedVersions;
151
- try {
152
- publishedVersions = fetchPublishedVersions(cwd);
153
- } catch {
154
- p.log.error("Could not fetch published @farming-labs/docs versions. Pass an exact version with " + pc.cyan("--version <version>") + ".");
155
- process.exit(1);
156
- }
157
- const previousVersion = getPreviousVersion(publishedVersions, currentVersion);
158
- if (!previousVersion) {
159
- p.log.error(`No published version found below current ${pc.cyan(currentVersion)}.`);
160
- process.exit(1);
161
- }
162
- targetVersion = previousVersion;
163
- }
164
- const pm = await resolveDocsPackageManager(cwd, "downgrade");
165
- const cmd = buildDowngradeCommand(framework, targetVersion, pm);
166
- p.log.step(`Downgrading ${preset} docs packages from ${currentVersion} to ${targetVersion}...`);
167
- p.log.message(pc.dim(packages.join(", ")));
168
- if (options.dryRun) {
169
- p.log.info("Dry run. Would run:\n " + pc.cyan(cmd));
170
- p.outro(pc.green("Dry run complete. No changes made."));
171
- return;
172
- }
173
- try {
174
- exec(cmd, cwd);
175
- p.log.success(`Packages downgraded to ${targetVersion}.`);
176
- p.outro(pc.green("Done. Run your dev server to confirm everything works."));
177
- } catch {
178
- p.log.error("Downgrade failed. Try running manually:\n " + pc.cyan(cmd));
179
- process.exit(1);
180
- }
181
- }
182
-
183
- //#endregion
184
- export { downgrade };
@@ -1,20 +0,0 @@
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 };