@docubook/flame 1.0.0-beta.50 → 1.0.0-beta.70

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 (47) hide show
  1. package/.docu/components/Anchor.tsx +1 -1
  2. package/.docu/components/Context.tsx +2 -2
  3. package/.docu/components/DocsLayout.tsx +1 -1
  4. package/.docu/components/EditWith.tsx +1 -1
  5. package/.docu/components/Menu.tsx +2 -2
  6. package/.docu/components/Navbar.tsx +1 -1
  7. package/.docu/components/Pagination.tsx +1 -1
  8. package/.docu/components/ScrollTo.tsx +1 -1
  9. package/.docu/components/Search.tsx +6 -6
  10. package/.docu/components/Sidebar.tsx +3 -3
  11. package/.docu/components/Social.tsx +1 -1
  12. package/.docu/components/Sublink.tsx +2 -2
  13. package/.docu/components/Toc.tsx +2 -2
  14. package/.docu/components/base/collapse.tsx +1 -1
  15. package/.docu/components/base/drawer.tsx +1 -1
  16. package/.docu/components/base/dropdown.tsx +1 -1
  17. package/.docu/components/base/input.tsx +1 -1
  18. package/.docu/components/base/kbd.tsx +1 -1
  19. package/.docu/components/base/modal.tsx +1 -1
  20. package/.docu/components/base/pagination.tsx +3 -3
  21. package/.docu/components/base/theme-controller.tsx +1 -1
  22. package/.docu/components/base/toggle.tsx +1 -1
  23. package/.docu/{lib → node}/build.ts +10 -41
  24. package/.docu/{lib → node}/fs-scanner.ts +2 -2
  25. package/.docu/node/mdx.ts +51 -0
  26. package/.docu/{lib → node}/paths.ts +5 -3
  27. package/.docu/{lib → node}/server.ts +8 -35
  28. package/.docu/pages/docs/[[...slug]].tsx +2 -2
  29. package/.docu/pages/index.tsx +1 -1
  30. package/bin/cli.js +3 -1
  31. package/package.json +6 -6
  32. /package/.docu/{lib → node}/clean.ts +0 -0
  33. /package/.docu/{lib → node}/client-routes.ts +0 -0
  34. /package/.docu/{lib → node}/client.ts +0 -0
  35. /package/.docu/{lib → node}/deploy.ts +0 -0
  36. /package/.docu/{lib → node}/helpers.ts +0 -0
  37. /package/.docu/{lib → node}/html.ts +0 -0
  38. /package/.docu/{lib → node}/hydrate.ts +0 -0
  39. /package/.docu/{lib → node}/logger.ts +0 -0
  40. /package/.docu/{lib → node}/preview.ts +0 -0
  41. /package/.docu/{lib → node}/route.ts +0 -0
  42. /package/.docu/{lib → node}/search-indexer.ts +0 -0
  43. /package/.docu/{lib → node}/search.ts +0 -0
  44. /package/.docu/{lib → node}/security.ts +0 -0
  45. /package/.docu/{lib → node}/sentry.ts +0 -0
  46. /package/.docu/{lib → node}/types.ts +0 -0
  47. /package/.docu/{lib → node}/utils.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  import { AnchorHTMLAttributes, ReactNode } from "react";
2
2
  import { ArrowUpRight } from "lucide-react";
3
- import { cn, isExternalUrl } from "../lib/utils";
3
+ import { cn, isExternalUrl } from "../node/utils";
4
4
 
5
5
  export interface AnchorProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
6
6
  href?: string;
@@ -1,9 +1,9 @@
1
1
  "use client";
2
2
 
3
3
  import { useState } from "react";
4
- import { cn } from "../lib/utils";
4
+ import { cn } from "../node/utils";
5
5
  import { Dropdown, DropdownItem } from "./base/dropdown";
6
- import { routes } from "../lib/client-routes";
6
+ import { routes } from "../node/client-routes";
7
7
  import { ChevronsUpDown, Check, type LucideIcon } from "lucide-react";
8
8
  import * as LucideIcons from "lucide-react";
9
9
 
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { loadDocuConfig } from "../lib/paths";
2
+ import { loadDocuConfig } from "../node/paths";
3
3
  import Menu from "./Menu";
4
4
 
5
5
  const docuConfig = loadDocuConfig();
@@ -1,5 +1,5 @@
1
1
  import { SquarePen } from "lucide-react";
2
- import { isEditEnabled, getEditLink, getRepoUrl } from "../lib/helpers";
2
+ import { isEditEnabled, getEditLink, getRepoUrl } from "../node/helpers";
3
3
 
4
4
  export interface EditWithProps {
5
5
  filePath: string;
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { useState } from "react";
4
4
  import Sublink from "./Sublink";
5
- import type { DocuRoute } from "../lib/types";
6
- import { cn } from "../lib/utils";
5
+ import type { DocuRoute } from "../node/types";
6
+ import { cn } from "../node/utils";
7
7
 
8
8
  interface MenuProps {
9
9
  onNavigate?: () => void;
@@ -1,7 +1,7 @@
1
1
  import type { ReactNode } from "react";
2
2
  import { useState } from "react";
3
3
  import Anchor from "./Anchor";
4
- import { cn } from "../lib/utils";
4
+ import { cn } from "../node/utils";
5
5
  import {
6
6
  Navbar as BaseNavbar,
7
7
  Logo as BaseLogo,
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { getPreviousNext } from "../lib/route";
3
+ import { getPreviousNext } from "../node/route";
4
4
  import { PaginationDocs } from "./base/pagination";
5
5
 
6
6
  interface PaginationProps {
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { ArrowUpIcon } from "lucide-react";
4
4
  import { useEffect, useState, useCallback } from "react";
5
- import { cn } from "../lib/utils";
5
+ import { cn } from "../node/utils";
6
6
 
7
7
  interface ScrollToProps {
8
8
  className?: string;
@@ -4,9 +4,9 @@ import { useState, useEffect, useRef, useCallback } from "react";
4
4
  import { Search as SearchIcon, FileText, CornerDownLeft, Hash, AlignLeft } from "lucide-react";
5
5
  import { Modal, useModal } from "./base/modal";
6
6
  import { Kbd, FnKey } from "./base/kbd";
7
- import { cn } from "../lib/utils";
8
- import { search, type SearchResult } from "../lib/search";
9
- import type { SearchRecord } from "../lib/search-indexer";
7
+ import { cn } from "../node/utils";
8
+ import { search, type SearchResult } from "../node/search";
9
+ import type { SearchRecord } from "../node/search-indexer";
10
10
 
11
11
  interface SearchProps {
12
12
  className?: string;
@@ -123,7 +123,7 @@ export default function Search({ className }: SearchProps) {
123
123
  boxClassName="w-[calc(100%-2rem)] max-w-[640px] p-0 mx-auto relative z-10"
124
124
  >
125
125
  <div onKeyDown={handleKeyDown}>
126
- <div className="px-4 pt-4 pb-2">
126
+ <div className="px-4 pb-2 pt-4">
127
127
  <div className="border-base-300 flex items-center gap-3 rounded-lg border px-4 py-2.5">
128
128
  <SearchIcon className="text-primary h-5 w-5 shrink-0" />
129
129
  <input
@@ -132,7 +132,7 @@ export default function Search({ className }: SearchProps) {
132
132
  onChange={handleQueryChange}
133
133
  placeholder="Search documentation..."
134
134
  autoFocus
135
- className="placeholder:text-base-content/40 h-8 w-full border-none bg-transparent text-base ring-0 outline-none focus:ring-0 focus:outline-none"
135
+ className="placeholder:text-base-content/40 h-8 w-full border-none bg-transparent text-base outline-none ring-0 focus:outline-none focus:ring-0"
136
136
  aria-label="Search documentation"
137
137
  />
138
138
  {query && (
@@ -264,7 +264,7 @@ function GroupedResults({
264
264
  <div className="flex flex-col gap-1">
265
265
  {groups.map((group) => (
266
266
  <div key={group.section}>
267
- <div className="text-base-content/50 px-2 pt-3 pb-1 text-xs font-semibold">
267
+ <div className="text-base-content/50 px-2 pb-1 pt-3 text-xs font-semibold">
268
268
  {group.section}
269
269
  </div>
270
270
  {group.items.map(({ result, globalIndex }) => {
@@ -10,14 +10,14 @@ import {
10
10
  FileText,
11
11
  } from "lucide-react";
12
12
  import { Dropdown, DropdownLink } from "./base/dropdown";
13
- import { cn } from "../lib/utils";
13
+ import { cn } from "../node/utils";
14
14
  import { Context } from "./Context";
15
15
  import Menu from "./Menu";
16
16
  import { ThemeToggle } from "./Theme";
17
17
  import { GitHubLink } from "./Navbar";
18
18
  import Search from "./Search";
19
- import type { TocItem } from "../lib/types";
20
- import { config as docuConfig, routes } from "../lib/client-routes";
19
+ import type { TocItem } from "../node/types";
20
+ import { config as docuConfig, routes } from "../node/client-routes";
21
21
 
22
22
  interface SidebarProps {
23
23
  tocs?: TocItem[];
@@ -1,4 +1,4 @@
1
- import { getSocialLinks } from "../lib/helpers";
1
+ import { getSocialLinks } from "../node/helpers";
2
2
 
3
3
  export interface SocialProps {
4
4
  className?: string;
@@ -3,8 +3,8 @@
3
3
  import { useState } from "react";
4
4
  import { ChevronDown } from "lucide-react";
5
5
  import Anchor from "./Anchor";
6
- import type { DocuRoute } from "../lib/types";
7
- import { cn } from "../lib/utils";
6
+ import type { DocuRoute } from "../node/types";
7
+ import { cn } from "../node/utils";
8
8
 
9
9
  interface SublinkProps extends DocuRoute {
10
10
  level: number;
@@ -2,9 +2,9 @@
2
2
 
3
3
  import { useState, useCallback, useEffect, useRef } from "react";
4
4
  import { ListIcon } from "lucide-react";
5
- import { cn } from "../lib/utils";
5
+ import { cn } from "../node/utils";
6
6
  import { ScrollTo } from "./ScrollTo";
7
- import { TocItem } from "../lib/types";
7
+ import { TocItem } from "../node/types";
8
8
 
9
9
  interface TocProps {
10
10
  tocs: TocItem[];
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { cn } from "../../lib/utils";
3
+ import { cn } from "../../node/utils";
4
4
  import { ChevronDown, ChevronRight, Plus, Minus } from "lucide-react";
5
5
  import { useState, type ReactNode } from "react";
6
6
 
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { cn } from "../../lib/utils";
3
+ import { cn } from "../../node/utils";
4
4
  import { X } from "lucide-react";
5
5
  import { useState, type ReactNode } from "react";
6
6
 
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { type HTMLAttributes, type ReactNode, forwardRef, useRef, useEffect } from "react";
4
- import { cn } from "../../lib/utils";
4
+ import { cn } from "../../node/utils";
5
5
 
6
6
  export interface DropdownProps extends HTMLAttributes<HTMLDetailsElement> {
7
7
  align?: "start" | "end";
@@ -1,5 +1,5 @@
1
1
  import { forwardRef } from "react";
2
- import { cn } from "../../lib/utils";
2
+ import { cn } from "../../node/utils";
3
3
 
4
4
  type InputColor =
5
5
  | "neutral"
@@ -13,7 +13,7 @@ import {
13
13
  Delete,
14
14
  ArrowRightToLine,
15
15
  } from "lucide-react";
16
- import { cn } from "../../lib/utils";
16
+ import { cn } from "../../node/utils";
17
17
 
18
18
  type KbdSize = "xs" | "sm" | "md" | "lg" | "xl";
19
19
 
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { forwardRef, useRef, useCallback } from "react";
4
- import { cn } from "../../lib/utils";
4
+ import { cn } from "../../node/utils";
5
5
 
6
6
  interface ModalProps extends React.DialogHTMLAttributes<HTMLDialogElement> {
7
7
  children: React.ReactNode;
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { cn } from "../../lib/utils";
3
+ import { cn } from "../../node/utils";
4
4
  import { ChevronLeft, ChevronRight } from "lucide-react";
5
5
  import { useMemo, type ReactNode } from "react";
6
6
 
@@ -504,7 +504,7 @@ export function PaginationDocs({ prev, next, className }: PaginationDocsProps) {
504
504
  {prev && (
505
505
  <a
506
506
  href={prev.href}
507
- className="btn btn-outline border-base-300 h-auto w-full flex-col items-start! py-2! pl-4 no-underline"
507
+ className="btn btn-outline border-base-300 items-start! py-2! h-auto w-full flex-col pl-4 no-underline"
508
508
  >
509
509
  <span className="text-muted-foreground flex items-center text-xs">
510
510
  <ChevronLeft className="mr-1 h-4 w-4" />
@@ -519,7 +519,7 @@ export function PaginationDocs({ prev, next, className }: PaginationDocsProps) {
519
519
  {next && (
520
520
  <a
521
521
  href={next.href}
522
- className="btn btn-outline border-base-300 h-auto w-full flex-col items-end! py-2! pr-4 no-underline"
522
+ className="btn btn-outline border-base-300 items-end! py-2! h-auto w-full flex-col pr-4 no-underline"
523
523
  >
524
524
  <span className="text-muted-foreground flex items-center text-xs">
525
525
  Next
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { useEffect, useRef, useState, type ReactNode } from "react";
4
- import { cn } from "../../lib/utils";
4
+ import { cn } from "../../node/utils";
5
5
 
6
6
  export type ThemeName =
7
7
  | "light"
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
 
3
- import { cn } from "../../lib/utils";
3
+ import { cn } from "../../node/utils";
4
4
  import type { InputHTMLAttributes, ReactNode } from "react";
5
5
  import { forwardRef, useState, useEffect } from "react";
6
6
 
@@ -4,16 +4,7 @@ import { createHash } from "node:crypto";
4
4
  import { join, dirname } from "node:path";
5
5
  import React from "react";
6
6
  import { renderToString } from "react-dom/server";
7
- import {
8
- serialize,
9
- extractTocsFromRawMdx,
10
- extractFrontmatterWithContent,
11
- createDefaultRehypePlugins,
12
- createDefaultRemarkPlugins,
13
- MDXRemote,
14
- } from "@docubook/core";
15
- import { createMdxComponents } from "@docubook/mdx-content";
16
- import { getGitLastModified } from "./utils";
7
+ import { compileMdx } from "./mdx";
17
8
  import {
18
9
  DOCS_DIR,
19
10
  DIST_DIR,
@@ -113,38 +104,16 @@ function htmlShell(title: string, description: string, body: string): string {
113
104
  }
114
105
 
115
106
  async function renderDocsPage(slug: string, rawMdx: string, filePath: string): Promise<string> {
116
- const tocs = extractTocsFromRawMdx(rawMdx);
117
- const { frontmatter, strippedContent } = extractFrontmatterWithContent<{
118
- title?: string;
119
- description?: string;
120
- date?: string;
121
- }>(rawMdx);
122
-
123
- const components = createMdxComponents();
124
- let compiledSource: string;
107
+ let result;
125
108
  try {
126
- const serialized = await serialize(strippedContent, {
127
- mdxOptions: {
128
- rehypePlugins: createDefaultRehypePlugins(),
129
- remarkPlugins: createDefaultRemarkPlugins(),
130
- },
131
- });
132
- compiledSource = serialized.compiledSource;
109
+ result = await compileMdx(rawMdx, filePath);
133
110
  } catch (err) {
134
111
  const msg = err instanceof Error ? err.message : "Unknown MDX error";
135
112
  throw new Error(`MDX Error in: docs/${slug}.mdx\n${msg}`, { cause: err });
136
113
  }
137
114
 
138
- const content = React.createElement(MDXRemote, {
139
- compiledSource,
140
- scope: {},
141
- frontmatter: {},
142
- components,
143
- });
144
-
145
- const title = frontmatter.title || slug || "Docs";
146
- const description = frontmatter.description || "";
147
- const date = frontmatter.date || (await getGitLastModified(filePath));
115
+ const title = result.frontmatter.title || slug || "Docs";
116
+ const description = result.frontmatter.description || "";
148
117
  const slugParts = slug ? slug.split("/") : [];
149
118
 
150
119
  const page = React.createElement(
@@ -154,12 +123,12 @@ async function renderDocsPage(slug: string, rawMdx: string, filePath: string): P
154
123
  slug: slugParts,
155
124
  title,
156
125
  description,
157
- date: date || undefined,
158
- content,
159
- tocs,
126
+ date: result.frontmatter.date || undefined,
127
+ content: result.content,
128
+ tocs: result.tocs,
160
129
  filePath,
161
130
  repoUrl: docuConfig.repo?.url,
162
- compiledSource,
131
+ compiledSource: result.compiledSource,
163
132
  })
164
133
  );
165
134
 
@@ -225,7 +194,7 @@ async function build() {
225
194
  logger.spinner.start("Building pages...");
226
195
  t = performance.now();
227
196
 
228
- const CONCURRENCY = parseInt(process.env.BUILD_CONCURRENCY || "10", 10);
197
+ const CONCURRENCY = Math.max(1, parseInt(process.env.BUILD_CONCURRENCY || "10", 10) || 10);
229
198
  const buildTasks = [];
230
199
  const errors: string[] = [];
231
200
 
@@ -107,7 +107,7 @@ function fileNodesToRoutes(nodes: FileNode[], parentHref = ""): DocuRoute[] {
107
107
  if (isIndexFile) continue;
108
108
 
109
109
  const segment = node.relPath.split("/").pop()!;
110
- const href = parentHref ? `${parentHref}/${segment}` : `/${node.relPath}`;
110
+ const href = `/${segment}`;
111
111
 
112
112
  routes.push({
113
113
  title: toTitleCase(baseName),
@@ -116,7 +116,7 @@ function fileNodesToRoutes(nodes: FileNode[], parentHref = ""): DocuRoute[] {
116
116
  } else {
117
117
  const dirTitle = toTitleCase(node.name);
118
118
  const segment = node.relPath.split("/").pop()!;
119
- const dirHref = parentHref ? `${parentHref}/${segment}` : `/${node.relPath}`;
119
+ const dirHref = `/${segment}`;
120
120
 
121
121
  const children = fileNodesToRoutes(node.children || [], dirHref);
122
122
 
@@ -0,0 +1,51 @@
1
+ import React from "react";
2
+ import {
3
+ serialize,
4
+ extractTocsFromRawMdx,
5
+ extractFrontmatterWithContent,
6
+ createDefaultRehypePlugins,
7
+ createDefaultRemarkPlugins,
8
+ MDXRemote,
9
+ } from "@docubook/core";
10
+ import { createMdxComponents } from "@docubook/mdx-content";
11
+ import { getGitLastModified } from "./utils";
12
+
13
+ export interface MdxResult {
14
+ content: React.ReactElement;
15
+ compiledSource: string;
16
+ frontmatter: { title?: string; description?: string; date?: string };
17
+ tocs: ReturnType<typeof extractTocsFromRawMdx>;
18
+ }
19
+
20
+ export async function compileMdx(rawMdx: string, filePath: string): Promise<MdxResult> {
21
+ const tocs = extractTocsFromRawMdx(rawMdx);
22
+ const { frontmatter, strippedContent } = extractFrontmatterWithContent<{
23
+ title?: string;
24
+ description?: string;
25
+ date?: string;
26
+ }>(rawMdx);
27
+
28
+ const serialized = await serialize(strippedContent, {
29
+ mdxOptions: {
30
+ rehypePlugins: createDefaultRehypePlugins(),
31
+ remarkPlugins: createDefaultRemarkPlugins(),
32
+ },
33
+ });
34
+
35
+ const components = createMdxComponents();
36
+ const content = React.createElement(MDXRemote, {
37
+ compiledSource: serialized.compiledSource,
38
+ scope: {},
39
+ frontmatter: {},
40
+ components,
41
+ });
42
+
43
+ const date = frontmatter.date || (await getGitLastModified(filePath)) || undefined;
44
+
45
+ return {
46
+ content,
47
+ compiledSource: serialized.compiledSource,
48
+ frontmatter: { ...frontmatter, date },
49
+ tocs,
50
+ };
51
+ }
@@ -3,18 +3,20 @@ import { existsSync, readFileSync } from "node:fs";
3
3
  import type { DocuConfig } from "./types";
4
4
 
5
5
  /**
6
- * FRAMEWORK_ROOT: Where the package code lives (.docu/components, .docu/pages, .docu/styles, .docu/lib)
6
+ * FRAMEWORK_ROOT: Where the package code lives (.docu/components, .docu/pages, .docu/styles, .docu/node)
7
7
  * PROJECT_ROOT: Where the user's project lives (docs/, docu.json)
8
8
  */
9
9
 
10
- // .docu/lib/paths.ts → package root is 2 levels up
10
+ // .docu/node/paths.ts → package root is 2 levels up
11
11
  export const FRAMEWORK_ROOT = resolve(import.meta.dirname, "../..");
12
12
  export const PROJECT_ROOT = process.cwd();
13
13
 
14
14
  // Framework paths (internal)
15
15
  export const PAGES_DIR = join(FRAMEWORK_ROOT, ".docu/pages");
16
16
  export const STYLES_DIR = join(FRAMEWORK_ROOT, ".docu/styles");
17
- export const LIB_DIR = join(FRAMEWORK_ROOT, ".docu/lib");
17
+ const nodeDir = join(FRAMEWORK_ROOT, ".docu/node");
18
+ const libDir = join(FRAMEWORK_ROOT, ".docu/lib");
19
+ export const LIB_DIR = existsSync(nodeDir) ? nodeDir : libDir;
18
20
 
19
21
  // Build output (user project)
20
22
  export const DIST_DIR = join(PROJECT_ROOT, ".docu/dist");
@@ -4,16 +4,8 @@ import { resolve, join } from "node:path";
4
4
  import { watch } from "node:fs";
5
5
  import React from "react";
6
6
  import { renderToString } from "react-dom/server";
7
- import {
8
- serialize,
9
- extractTocsFromRawMdx,
10
- extractFrontmatterWithContent,
11
- createDefaultRehypePlugins,
12
- createDefaultRemarkPlugins,
13
- MDXRemote,
14
- } from "@docubook/core";
15
- import { createMdxComponents } from "@docubook/mdx-content";
16
- import { getGitLastModified, getContentType } from "./utils";
7
+ import { getContentType } from "./utils";
8
+ import { compileMdx } from "./mdx";
17
9
  import { DOCS_DIR, DIST_DIR, PAGES_DIR, PROJECT_ROOT, loadDocuConfig } from "./paths";
18
10
  import DocsPage from "../pages/docs/[[...slug]]";
19
11
  import NotFoundPage from "../pages/404";
@@ -139,34 +131,15 @@ async function getDocsForSlug(slug: string) {
139
131
  }
140
132
  }
141
133
  if (!filePath || !raw) return null;
142
- const tocs = extractTocsFromRawMdx(raw);
143
- const { frontmatter, strippedContent } = extractFrontmatterWithContent<{
144
- title?: string;
145
- description?: string;
146
- date?: string;
147
- }>(raw);
148
-
149
- const components = createMdxComponents();
150
- const serialized = await serialize(strippedContent, {
151
- mdxOptions: {
152
- rehypePlugins: createDefaultRehypePlugins(),
153
- remarkPlugins: createDefaultRemarkPlugins(),
154
- },
155
- });
156
- const content = React.createElement(MDXRemote, {
157
- compiledSource: serialized.compiledSource,
158
- scope: {},
159
- frontmatter: {},
160
- components,
161
- });
162
134
 
163
135
  const relPath = filePath.replace(PROJECT_ROOT + "/", "");
164
- const date = frontmatter.date || (await getGitLastModified(relPath)) || undefined;
136
+ const result = await compileMdx(raw, relPath);
137
+
165
138
  return {
166
- content,
167
- compiledSource: serialized.compiledSource,
168
- frontmatter: { ...frontmatter, date },
169
- tocs,
139
+ content: result.content,
140
+ compiledSource: result.compiledSource,
141
+ frontmatter: result.frontmatter,
142
+ tocs: result.tocs,
170
143
  filePath: relPath,
171
144
  };
172
145
  }
@@ -3,8 +3,8 @@ import DocsBreadcrumb from "../../components/Breadcrumb";
3
3
  import Pagination from "../../components/Pagination";
4
4
  import { Typography } from "../../components/Typography";
5
5
  import EditWith from "../../components/EditWith";
6
- import { formatDate2 } from "../../lib/utils";
7
- import type { TocItem } from "../../lib/types";
6
+ import { formatDate2 } from "../../node/utils";
7
+ import type { TocItem } from "../../node/types";
8
8
  import { Footer } from "../../components/Footer";
9
9
  import Toc from "../../components/Toc";
10
10
 
@@ -1,5 +1,5 @@
1
1
  import * as icons from "lucide-react";
2
- import { loadDocuConfig } from "../lib/paths";
2
+ import { loadDocuConfig } from "../node/paths";
3
3
 
4
4
  const docuConfig = loadDocuConfig();
5
5
 
package/bin/cli.js CHANGED
@@ -78,5 +78,7 @@ if (!(command in COMMAND_MAP)) {
78
78
  process.exit(1);
79
79
  }
80
80
 
81
- const scriptPath = resolve(__dirname, "../.docu/lib", COMMAND_MAP[command]);
81
+ const nodePath = resolve(__dirname, "../.docu/node", COMMAND_MAP[command]);
82
+ const libPath = resolve(__dirname, "../.docu/lib", COMMAND_MAP[command]);
83
+ const scriptPath = existsSync(nodePath) ? nodePath : libPath;
82
84
  await import(scriptPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docubook/flame",
3
- "version": "1.0.0-beta.50",
3
+ "version": "1.0.0-beta.70",
4
4
  "description": "A blazing-fast React + MDX framework powered by Bun, built for modern documentation experiences.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -76,11 +76,11 @@
76
76
  "typescript-eslint": "^8.59.2"
77
77
  },
78
78
  "scripts": {
79
- "dev": "bun .docu/lib/server.ts",
80
- "build": "NODE_ENV=production bun .docu/lib/build.ts",
81
- "clean": "bun .docu/lib/clean.ts",
82
- "preview": "bun .docu/lib/preview.ts",
83
- "deploy": "bun .docu/lib/deploy.ts",
79
+ "dev": "bun .docu/node/server.ts",
80
+ "build": "NODE_ENV=production bun .docu/node/build.ts",
81
+ "clean": "bun .docu/node/clean.ts",
82
+ "preview": "bun .docu/node/preview.ts",
83
+ "deploy": "bun .docu/node/deploy.ts",
84
84
  "test": "vitest run",
85
85
  "lint": "eslint ."
86
86
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes