@farming-labs/theme 0.0.23 → 0.0.25

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 (53) hide show
  1. package/dist/_virtual/_rolldown/runtime.mjs +26 -1
  2. package/dist/docs-api.mjs +3 -1
  3. package/dist/docs-layout.mjs +7 -3
  4. package/dist/get-app-dir.d.mts +9 -0
  5. package/dist/get-app-dir.mjs +16 -0
  6. package/dist/get-app-dir.test.d.mts +1 -0
  7. package/dist/get-app-dir.test.mjs +41 -0
  8. package/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs +77 -0
  9. package/dist/node_modules/.pnpm/@vitest_expect@3.2.4/node_modules/@vitest/expect/dist/index.mjs +1356 -0
  10. package/dist/node_modules/.pnpm/@vitest_pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.mjs +1119 -0
  11. package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.mjs +1091 -0
  12. package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/index.mjs +4 -0
  13. package/dist/node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/utils.mjs +3 -0
  14. package/dist/node_modules/.pnpm/@vitest_snapshot@3.2.4/node_modules/@vitest/snapshot/dist/index.mjs +1821 -0
  15. package/dist/node_modules/.pnpm/@vitest_spy@3.2.4/node_modules/@vitest/spy/dist/index.mjs +171 -0
  16. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.mjs +124 -0
  17. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/diff.mjs +1334 -0
  18. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/error.mjs +105 -0
  19. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/helpers.mjs +118 -0
  20. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/index.mjs +455 -0
  21. package/dist/node_modules/.pnpm/@vitest_utils@3.2.4/node_modules/@vitest/utils/dist/source-map.mjs +168 -0
  22. package/dist/node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.mjs +3087 -0
  23. package/dist/node_modules/.pnpm/js-tokens@9.0.1/node_modules/js-tokens/index.mjs +384 -0
  24. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.mjs +11 -0
  25. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.mjs +16 -0
  26. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.mjs +11 -0
  27. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.mjs +15 -0
  28. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.mjs +13 -0
  29. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.mjs +34 -0
  30. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.mjs +12 -0
  31. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.mjs +122 -0
  32. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.mjs +39 -0
  33. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.mjs +99 -0
  34. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.mjs +25 -0
  35. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.mjs +14 -0
  36. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.mjs +21 -0
  37. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.mjs +5 -0
  38. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.mjs +12 -0
  39. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.mjs +18 -0
  40. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.mjs +25 -0
  41. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.mjs +8 -0
  42. package/dist/node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.mjs +30 -0
  43. package/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs +939 -0
  44. package/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +81 -0
  45. package/dist/node_modules/.pnpm/strip-literal@3.1.0/node_modules/strip-literal/dist/index.mjs +51 -0
  46. package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.mjs +81 -0
  47. package/dist/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/node.mjs +9 -0
  48. package/dist/node_modules/.pnpm/tinyspy@4.0.4/node_modules/tinyspy/dist/index.mjs +125 -0
  49. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@22.19.11_jiti@2.6.1_lightningcss@1.30.2_terser@5.46.0_yaml@2.8.2/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.mjs +8 -0
  50. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@22.19.11_jiti@2.6.1_lightningcss@1.30.2_terser@5.46.0_yaml@2.8.2/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.mjs +50 -0
  51. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@22.19.11_jiti@2.6.1_lightningcss@1.30.2_terser@5.46.0_yaml@2.8.2/node_modules/vitest/dist/chunks/utils.XdZDrNZV.mjs +48 -0
  52. package/dist/node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@22.19.11_jiti@2.6.1_lightningcss@1.30.2_terser@5.46.0_yaml@2.8.2/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.mjs +2613 -0
  53. package/package.json +6 -3
@@ -1,7 +1,32 @@
1
1
  import { createRequire } from "node:module";
2
2
 
3
3
  //#region \0rolldown/runtime.js
4
+ var __create = Object.create;
5
+ var __defProp = Object.defineProperty;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __getProtoOf = Object.getPrototypeOf;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
14
+ key = keys[i];
15
+ if (!__hasOwnProp.call(to, key) && key !== except) {
16
+ __defProp(to, key, {
17
+ get: ((k) => from[k]).bind(null, key),
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
21
+ }
22
+ }
23
+ return to;
24
+ };
25
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
26
+ value: mod,
27
+ enumerable: true
28
+ }) : target, mod));
4
29
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
5
30
 
6
31
  //#endregion
7
- export { __require };
32
+ export { __commonJSMin, __require, __toESM };
package/dist/docs-api.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ import { getNextAppDir } from "./get-app-dir.mjs";
1
2
  import fs from "node:fs";
2
3
  import path from "node:path";
3
4
  import matter from "gray-matter";
@@ -248,7 +249,8 @@ function generateLlmsTxt(indexes, options) {
248
249
  function createDocsAPI(options) {
249
250
  const root = process.cwd();
250
251
  const entry = options?.entry ?? readEntry(root);
251
- const docsDir = path.join(root, "app", entry);
252
+ const appDir = getNextAppDir(root);
253
+ const docsDir = path.join(root, appDir, entry);
252
254
  const language = options?.language ?? "english";
253
255
  const aiConfig = options?.ai ?? readAIConfig(root);
254
256
  const llmsConfig = readLlmsTxtConfig(root);
@@ -1,4 +1,5 @@
1
1
  import { DocsAIFeatures } from "./docs-ai-features.mjs";
2
+ import { getNextAppDir } from "./get-app-dir.mjs";
2
3
  import { DocsCommandSearch } from "./docs-command-search.mjs";
3
4
  import { serializeIcon } from "./serialize-icon.mjs";
4
5
  import { DocsPageClient } from "./docs-page-client.mjs";
@@ -35,7 +36,8 @@ function hasChildPages(dir) {
35
36
  return false;
36
37
  }
37
38
  function buildTree(config, flat = false) {
38
- const docsDir = path.join(process.cwd(), "app", config.entry);
39
+ const appDir = getNextAppDir(process.cwd());
40
+ const docsDir = path.join(process.cwd(), appDir, config.entry);
39
41
  const icons = config.icons;
40
42
  const ordering = config.ordering;
41
43
  const rootChildren = [];
@@ -143,7 +145,8 @@ function buildTree(config, flat = false) {
143
145
  * a map of URL pathname → formatted last-modified date string.
144
146
  */
145
147
  function buildLastModifiedMap(entry) {
146
- const docsDir = path.join(process.cwd(), "app", entry);
148
+ const appDir = getNextAppDir(process.cwd());
149
+ const docsDir = path.join(process.cwd(), appDir, entry);
147
150
  const map = {};
148
151
  function formatDate(date) {
149
152
  return date.toLocaleDateString("en-US", {
@@ -172,7 +175,8 @@ function buildLastModifiedMap(entry) {
172
175
  * from the frontmatter `description` field.
173
176
  */
174
177
  function buildDescriptionMap(entry) {
175
- const docsDir = path.join(process.cwd(), "app", entry);
178
+ const appDir = getNextAppDir(process.cwd());
179
+ const docsDir = path.join(process.cwd(), appDir, entry);
176
180
  const map = {};
177
181
  function scan(dir, slugParts) {
178
182
  if (!fs.existsSync(dir)) return;
@@ -0,0 +1,9 @@
1
+ //#region src/get-app-dir.d.ts
2
+ /**
3
+ * Resolve Next.js App Router directory.
4
+ * Prefers src/app when present (src directory layout), else app.
5
+ * Use this so docs layout and API resolve MDX content in the same place the CLI generated it.
6
+ */
7
+ declare function getNextAppDir(root: string): string;
8
+ //#endregion
9
+ export { getNextAppDir };
@@ -0,0 +1,16 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+
4
+ //#region src/get-app-dir.ts
5
+ /**
6
+ * Resolve Next.js App Router directory.
7
+ * Prefers src/app when present (src directory layout), else app.
8
+ * Use this so docs layout and API resolve MDX content in the same place the CLI generated it.
9
+ */
10
+ function getNextAppDir(root) {
11
+ if (fs.existsSync(path.join(root, "src", "app"))) return "src/app";
12
+ return "app";
13
+ }
14
+
15
+ //#endregion
16
+ export { getNextAppDir };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,41 @@
1
+ import { getNextAppDir } from "./get-app-dir.mjs";
2
+ import { afterEach, beforeEach, describe, it } from "./node_modules/.pnpm/@vitest_runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.mjs";
3
+ import { globalExpect } from "./node_modules/.pnpm/vitest@3.2.4_@types_debug@4.1.12_@types_node@22.19.11_jiti@2.6.1_lightningcss@1.30.2_terser@5.46.0_yaml@2.8.2/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.mjs";
4
+ import fs from "node:fs";
5
+ import path from "node:path";
6
+ import os from "node:os";
7
+
8
+ //#region src/get-app-dir.test.ts
9
+ describe("getNextAppDir", () => {
10
+ let tmpDir;
11
+ beforeEach(() => {
12
+ tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "get-app-dir-test-"));
13
+ });
14
+ afterEach(() => {
15
+ try {
16
+ fs.rmSync(tmpDir, {
17
+ recursive: true,
18
+ force: true
19
+ });
20
+ } catch {}
21
+ });
22
+ it("returns \"app\" when only app exists", () => {
23
+ fs.mkdirSync(path.join(tmpDir, "app"), { recursive: true });
24
+ globalExpect(getNextAppDir(tmpDir)).toBe("app");
25
+ });
26
+ it("returns \"src/app\" when only src/app exists", () => {
27
+ fs.mkdirSync(path.join(tmpDir, "src", "app"), { recursive: true });
28
+ globalExpect(getNextAppDir(tmpDir)).toBe("src/app");
29
+ });
30
+ it("prefers \"src/app\" when both app and src/app exist", () => {
31
+ fs.mkdirSync(path.join(tmpDir, "app"), { recursive: true });
32
+ fs.mkdirSync(path.join(tmpDir, "src", "app"), { recursive: true });
33
+ globalExpect(getNextAppDir(tmpDir)).toBe("src/app");
34
+ });
35
+ it("returns \"app\" when neither exists (default)", () => {
36
+ globalExpect(getNextAppDir(tmpDir)).toBe("app");
37
+ });
38
+ });
39
+
40
+ //#endregion
41
+ export { };
@@ -0,0 +1,77 @@
1
+ //#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
2
+ var comma = ",".charCodeAt(0);
3
+ var semicolon = ";".charCodeAt(0);
4
+ var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
5
+ var intToChar = new Uint8Array(64);
6
+ var charToInt = new Uint8Array(128);
7
+ for (let i = 0; i < chars.length; i++) {
8
+ const c = chars.charCodeAt(i);
9
+ intToChar[i] = c;
10
+ charToInt[c] = i;
11
+ }
12
+ function encodeInteger(builder, num, relative) {
13
+ let delta = num - relative;
14
+ delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
15
+ do {
16
+ let clamped = delta & 31;
17
+ delta >>>= 5;
18
+ if (delta > 0) clamped |= 32;
19
+ builder.write(intToChar[clamped]);
20
+ } while (delta > 0);
21
+ return num;
22
+ }
23
+ var bufLength = 1024 * 16;
24
+ var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { decode(buf) {
25
+ return Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength).toString();
26
+ } } : { decode(buf) {
27
+ let out = "";
28
+ for (let i = 0; i < buf.length; i++) out += String.fromCharCode(buf[i]);
29
+ return out;
30
+ } };
31
+ var StringWriter = class {
32
+ constructor() {
33
+ this.pos = 0;
34
+ this.out = "";
35
+ this.buffer = new Uint8Array(bufLength);
36
+ }
37
+ write(v) {
38
+ const { buffer } = this;
39
+ buffer[this.pos++] = v;
40
+ if (this.pos === bufLength) {
41
+ this.out += td.decode(buffer);
42
+ this.pos = 0;
43
+ }
44
+ }
45
+ flush() {
46
+ const { buffer, out, pos } = this;
47
+ return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
48
+ }
49
+ };
50
+ function encode(decoded) {
51
+ const writer = new StringWriter();
52
+ let sourcesIndex = 0;
53
+ let sourceLine = 0;
54
+ let sourceColumn = 0;
55
+ let namesIndex = 0;
56
+ for (let i = 0; i < decoded.length; i++) {
57
+ const line = decoded[i];
58
+ if (i > 0) writer.write(semicolon);
59
+ if (line.length === 0) continue;
60
+ let genColumn = 0;
61
+ for (let j = 0; j < line.length; j++) {
62
+ const segment = line[j];
63
+ if (j > 0) writer.write(comma);
64
+ genColumn = encodeInteger(writer, segment[0], genColumn);
65
+ if (segment.length === 1) continue;
66
+ sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
67
+ sourceLine = encodeInteger(writer, segment[2], sourceLine);
68
+ sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
69
+ if (segment.length === 4) continue;
70
+ namesIndex = encodeInteger(writer, segment[4], namesIndex);
71
+ }
72
+ }
73
+ return writer.flush();
74
+ }
75
+
76
+ //#endregion
77
+ export { encode };