boltdocs 1.10.2 → 2.0.0

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 (250) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +21 -0
  3. package/dist/cache-7G6D532T.mjs +1 -0
  4. package/dist/chunk-A4HQPEPU.mjs +1 -0
  5. package/dist/chunk-BA5NH5HU.mjs +1 -0
  6. package/dist/chunk-BQCD3DWG.mjs +1 -0
  7. package/dist/chunk-H63UMKYF.mjs +1 -0
  8. package/dist/chunk-IWHRQHS7.mjs +1 -0
  9. package/dist/chunk-JZXLCA2E.mjs +1 -0
  10. package/dist/chunk-MFU7Q6WF.mjs +1 -0
  11. package/dist/chunk-QYPNX5UN.mjs +1 -0
  12. package/dist/chunk-XEAPSFMB.mjs +1 -0
  13. package/dist/client/components/mdx/index.d.mts +209 -0
  14. package/dist/client/components/mdx/index.d.ts +209 -0
  15. package/dist/client/components/mdx/index.js +1 -0
  16. package/dist/client/components/mdx/index.mjs +1 -0
  17. package/dist/client/hooks/index.d.mts +133 -0
  18. package/dist/client/hooks/index.d.ts +133 -0
  19. package/dist/client/hooks/index.js +1 -0
  20. package/dist/client/hooks/index.mjs +1 -0
  21. package/dist/client/index.d.mts +138 -298
  22. package/dist/client/index.d.ts +138 -298
  23. package/dist/client/index.js +1 -3630
  24. package/dist/client/index.mjs +1 -697
  25. package/dist/client/ssr.d.mts +7 -3
  26. package/dist/client/ssr.d.ts +7 -3
  27. package/dist/client/ssr.js +1 -2928
  28. package/dist/client/ssr.mjs +1 -33
  29. package/dist/{config-BsFQ-ErD.d.ts → config-CX4l-ZNp.d.mts} +42 -35
  30. package/dist/{config-BsFQ-ErD.d.mts → config-CX4l-ZNp.d.ts} +42 -35
  31. package/dist/node/index.d.mts +2 -4
  32. package/dist/node/index.d.ts +2 -4
  33. package/dist/node/index.js +31 -1161
  34. package/dist/node/index.mjs +31 -736
  35. package/dist/search-dialog-EB3N4TYM.mjs +1 -0
  36. package/dist/types-BuZWFT7r.d.ts +159 -0
  37. package/dist/types-CvT-SGbK.d.mts +159 -0
  38. package/dist/use-routes-5bAtAAYX.d.mts +30 -0
  39. package/dist/use-routes-BefRXY3v.d.ts +30 -0
  40. package/package.json +34 -12
  41. package/src/client/app/config-context.tsx +18 -0
  42. package/src/client/app/docs-layout.tsx +14 -0
  43. package/src/client/app/index.tsx +137 -262
  44. package/src/client/app/mdx-component.tsx +52 -0
  45. package/src/client/app/mdx-components-context.tsx +23 -0
  46. package/src/client/app/mdx-page.tsx +20 -0
  47. package/src/client/app/preload.tsx +38 -30
  48. package/src/client/app/router.tsx +30 -0
  49. package/src/client/app/scroll-handler.tsx +40 -0
  50. package/src/client/app/theme-context.tsx +75 -0
  51. package/src/client/components/default-layout.tsx +80 -0
  52. package/src/client/components/docs-layout.tsx +105 -0
  53. package/src/client/components/icons-dev.tsx +74 -0
  54. package/src/client/components/mdx/admonition.tsx +107 -0
  55. package/src/client/components/mdx/badge.tsx +41 -0
  56. package/src/client/components/mdx/button.tsx +35 -0
  57. package/src/client/components/mdx/card.tsx +124 -0
  58. package/src/client/components/mdx/code-block.tsx +119 -0
  59. package/src/client/components/mdx/component-preview.tsx +47 -0
  60. package/src/client/components/mdx/component-props.tsx +83 -0
  61. package/src/client/components/mdx/field.tsx +66 -0
  62. package/src/client/components/mdx/file-tree.tsx +287 -0
  63. package/src/client/components/mdx/hooks/use-code-block.ts +56 -0
  64. package/src/client/components/mdx/hooks/use-component-preview.ts +16 -0
  65. package/src/client/components/mdx/hooks/useTable.ts +74 -0
  66. package/src/client/components/mdx/hooks/useTabs.ts +68 -0
  67. package/src/client/components/mdx/image.tsx +23 -0
  68. package/src/client/components/mdx/index.ts +53 -0
  69. package/src/client/components/mdx/link.tsx +38 -0
  70. package/src/client/components/mdx/list.tsx +192 -0
  71. package/src/client/components/mdx/table.tsx +156 -0
  72. package/src/client/components/mdx/tabs.tsx +135 -0
  73. package/src/client/components/mdx/video.tsx +68 -0
  74. package/src/client/components/primitives/breadcrumbs.tsx +79 -0
  75. package/src/client/components/primitives/button-group.tsx +54 -0
  76. package/src/client/components/primitives/button.tsx +145 -0
  77. package/src/client/components/primitives/helpers/observer.ts +120 -0
  78. package/src/client/components/primitives/index.ts +17 -0
  79. package/src/client/components/primitives/link.tsx +122 -0
  80. package/src/client/components/primitives/menu.tsx +159 -0
  81. package/src/client/components/primitives/navbar.tsx +359 -0
  82. package/src/client/components/primitives/navigation-menu.tsx +116 -0
  83. package/src/client/components/primitives/on-this-page.tsx +461 -0
  84. package/src/client/components/primitives/page-nav.tsx +87 -0
  85. package/src/client/components/primitives/popover.tsx +47 -0
  86. package/src/client/components/primitives/search-dialog.tsx +183 -0
  87. package/src/client/components/primitives/sidebar.tsx +154 -0
  88. package/src/client/components/primitives/tabs.tsx +90 -0
  89. package/src/client/components/primitives/tooltip.tsx +83 -0
  90. package/src/client/components/primitives/types.ts +11 -0
  91. package/src/client/components/ui-base/breadcrumbs.tsx +42 -0
  92. package/src/client/components/ui-base/copy-markdown.tsx +112 -0
  93. package/src/client/components/ui-base/error-boundary.tsx +52 -0
  94. package/src/client/components/ui-base/github-stars.tsx +27 -0
  95. package/src/client/components/ui-base/head.tsx +69 -0
  96. package/src/client/components/ui-base/loading.tsx +87 -0
  97. package/src/client/components/ui-base/navbar.tsx +138 -0
  98. package/src/client/components/ui-base/not-found.tsx +24 -0
  99. package/src/client/components/ui-base/on-this-page.tsx +152 -0
  100. package/src/client/components/ui-base/page-nav.tsx +39 -0
  101. package/src/client/components/ui-base/powered-by.tsx +19 -0
  102. package/src/client/components/ui-base/progress-bar.tsx +67 -0
  103. package/src/client/components/ui-base/search-dialog.tsx +82 -0
  104. package/src/client/components/ui-base/sidebar.tsx +104 -0
  105. package/src/client/components/ui-base/tabs.tsx +65 -0
  106. package/src/client/components/ui-base/theme-toggle.tsx +32 -0
  107. package/src/client/hooks/index.ts +12 -0
  108. package/src/client/hooks/use-breadcrumbs.ts +22 -0
  109. package/src/client/hooks/use-i18n.ts +84 -0
  110. package/src/client/hooks/use-localized-to.ts +95 -0
  111. package/src/client/hooks/use-location.ts +5 -0
  112. package/src/client/hooks/use-navbar.ts +60 -0
  113. package/src/client/hooks/use-onthispage.ts +23 -0
  114. package/src/client/hooks/use-page-nav.ts +22 -0
  115. package/src/client/hooks/use-routes.ts +72 -0
  116. package/src/client/hooks/use-search.ts +71 -0
  117. package/src/client/hooks/use-sidebar.ts +49 -0
  118. package/src/client/hooks/use-tabs.ts +43 -0
  119. package/src/client/hooks/use-version.ts +78 -0
  120. package/src/client/index.ts +55 -17
  121. package/src/client/integrations/codesandbox.ts +179 -0
  122. package/src/client/ssr.tsx +27 -16
  123. package/src/client/theme/neutral.css +360 -0
  124. package/src/client/types.ts +131 -27
  125. package/src/client/utils/cn.ts +6 -0
  126. package/src/client/utils/copy-clipboard.ts +22 -0
  127. package/src/client/utils/get-base-file-path.ts +21 -0
  128. package/src/client/utils/github.ts +121 -0
  129. package/src/client/utils/use-on-change.ts +15 -0
  130. package/src/client/virtual.d.ts +24 -0
  131. package/src/node/cache.ts +156 -156
  132. package/src/node/config.ts +159 -103
  133. package/src/node/index.ts +13 -13
  134. package/src/node/mdx.ts +213 -61
  135. package/src/node/plugin/entry.ts +29 -18
  136. package/src/node/plugin/html.ts +11 -11
  137. package/src/node/plugin/index.ts +161 -84
  138. package/src/node/plugin/types.ts +2 -4
  139. package/src/node/routes/cache.ts +6 -6
  140. package/src/node/routes/index.ts +206 -113
  141. package/src/node/routes/parser.ts +102 -82
  142. package/src/node/routes/sorter.ts +15 -15
  143. package/src/node/routes/types.ts +24 -24
  144. package/src/node/ssg/index.ts +73 -47
  145. package/src/node/ssg/meta.ts +4 -4
  146. package/src/node/ssg/options.ts +5 -5
  147. package/src/node/ssg/sitemap.ts +14 -14
  148. package/src/node/utils.ts +54 -31
  149. package/tsconfig.json +25 -20
  150. package/tsup.config.ts +23 -14
  151. package/dist/PackageManagerTabs-NVT7G625.mjs +0 -99
  152. package/dist/SearchDialog-AGVF6JBO.mjs +0 -194
  153. package/dist/SearchDialog-YPDOM7Q6.css +0 -2847
  154. package/dist/Video-KNTY5BNO.mjs +0 -6
  155. package/dist/cache-KNL5B4EE.mjs +0 -12
  156. package/dist/chunk-7SFUJWTB.mjs +0 -211
  157. package/dist/chunk-FFBNU6IJ.mjs +0 -386
  158. package/dist/chunk-FMTOYQLO.mjs +0 -37
  159. package/dist/chunk-TKLQWU7H.mjs +0 -1920
  160. package/dist/chunk-Z7JHYNAS.mjs +0 -57
  161. package/dist/client/index.css +0 -2847
  162. package/dist/client/ssr.css +0 -2847
  163. package/dist/types-Dj-bfnC3.d.mts +0 -74
  164. package/dist/types-Dj-bfnC3.d.ts +0 -74
  165. package/src/client/theme/components/CodeBlock/CodeBlock.tsx +0 -61
  166. package/src/client/theme/components/CodeBlock/index.ts +0 -1
  167. package/src/client/theme/components/PackageManagerTabs/PackageManagerTabs.tsx +0 -131
  168. package/src/client/theme/components/PackageManagerTabs/index.ts +0 -1
  169. package/src/client/theme/components/PackageManagerTabs/pkg-tabs.css +0 -64
  170. package/src/client/theme/components/Playground/Playground.tsx +0 -180
  171. package/src/client/theme/components/Playground/index.ts +0 -1
  172. package/src/client/theme/components/Playground/playground.css +0 -238
  173. package/src/client/theme/components/Video/Video.tsx +0 -84
  174. package/src/client/theme/components/Video/index.ts +0 -1
  175. package/src/client/theme/components/Video/video.css +0 -41
  176. package/src/client/theme/components/mdx/Admonition.tsx +0 -80
  177. package/src/client/theme/components/mdx/Badge.tsx +0 -31
  178. package/src/client/theme/components/mdx/Button.tsx +0 -50
  179. package/src/client/theme/components/mdx/Card.tsx +0 -80
  180. package/src/client/theme/components/mdx/Field.tsx +0 -60
  181. package/src/client/theme/components/mdx/FileTree.tsx +0 -229
  182. package/src/client/theme/components/mdx/List.tsx +0 -57
  183. package/src/client/theme/components/mdx/Table.tsx +0 -151
  184. package/src/client/theme/components/mdx/Tabs.tsx +0 -123
  185. package/src/client/theme/components/mdx/index.ts +0 -27
  186. package/src/client/theme/components/mdx/mdx-components.css +0 -764
  187. package/src/client/theme/icons/bun.tsx +0 -62
  188. package/src/client/theme/icons/deno.tsx +0 -20
  189. package/src/client/theme/icons/discord.tsx +0 -12
  190. package/src/client/theme/icons/github.tsx +0 -15
  191. package/src/client/theme/icons/npm.tsx +0 -13
  192. package/src/client/theme/icons/pnpm.tsx +0 -72
  193. package/src/client/theme/icons/twitter.tsx +0 -12
  194. package/src/client/theme/styles/markdown.css +0 -394
  195. package/src/client/theme/styles/variables.css +0 -175
  196. package/src/client/theme/styles.css +0 -39
  197. package/src/client/theme/ui/Breadcrumbs/Breadcrumbs.tsx +0 -68
  198. package/src/client/theme/ui/Breadcrumbs/index.ts +0 -1
  199. package/src/client/theme/ui/CopyMarkdown/CopyMarkdown.tsx +0 -82
  200. package/src/client/theme/ui/CopyMarkdown/copy-markdown.css +0 -112
  201. package/src/client/theme/ui/CopyMarkdown/index.ts +0 -1
  202. package/src/client/theme/ui/ErrorBoundary/ErrorBoundary.tsx +0 -50
  203. package/src/client/theme/ui/ErrorBoundary/error-boundary.css +0 -55
  204. package/src/client/theme/ui/ErrorBoundary/index.ts +0 -1
  205. package/src/client/theme/ui/Footer/footer.css +0 -32
  206. package/src/client/theme/ui/Head/Head.tsx +0 -69
  207. package/src/client/theme/ui/Head/index.ts +0 -1
  208. package/src/client/theme/ui/LanguageSwitcher/LanguageSwitcher.tsx +0 -125
  209. package/src/client/theme/ui/LanguageSwitcher/index.ts +0 -1
  210. package/src/client/theme/ui/LanguageSwitcher/language-switcher.css +0 -98
  211. package/src/client/theme/ui/Layout/Layout.tsx +0 -203
  212. package/src/client/theme/ui/Layout/base.css +0 -106
  213. package/src/client/theme/ui/Layout/index.ts +0 -2
  214. package/src/client/theme/ui/Layout/pagination.css +0 -72
  215. package/src/client/theme/ui/Layout/responsive.css +0 -47
  216. package/src/client/theme/ui/Link/Link.tsx +0 -392
  217. package/src/client/theme/ui/Link/LinkPreview.tsx +0 -59
  218. package/src/client/theme/ui/Link/index.ts +0 -2
  219. package/src/client/theme/ui/Link/link-preview.css +0 -48
  220. package/src/client/theme/ui/Loading/Loading.tsx +0 -10
  221. package/src/client/theme/ui/Loading/index.ts +0 -1
  222. package/src/client/theme/ui/Loading/loading.css +0 -30
  223. package/src/client/theme/ui/Navbar/GithubStars.tsx +0 -27
  224. package/src/client/theme/ui/Navbar/Navbar.tsx +0 -193
  225. package/src/client/theme/ui/Navbar/Tabs.tsx +0 -99
  226. package/src/client/theme/ui/Navbar/index.ts +0 -2
  227. package/src/client/theme/ui/Navbar/navbar.css +0 -347
  228. package/src/client/theme/ui/NotFound/NotFound.tsx +0 -19
  229. package/src/client/theme/ui/NotFound/index.ts +0 -1
  230. package/src/client/theme/ui/NotFound/not-found.css +0 -64
  231. package/src/client/theme/ui/OnThisPage/OnThisPage.tsx +0 -244
  232. package/src/client/theme/ui/OnThisPage/index.ts +0 -1
  233. package/src/client/theme/ui/OnThisPage/toc.css +0 -152
  234. package/src/client/theme/ui/PoweredBy/PoweredBy.tsx +0 -18
  235. package/src/client/theme/ui/PoweredBy/index.ts +0 -1
  236. package/src/client/theme/ui/PoweredBy/powered-by.css +0 -76
  237. package/src/client/theme/ui/ProgressBar/ProgressBar.css +0 -17
  238. package/src/client/theme/ui/ProgressBar/ProgressBar.tsx +0 -51
  239. package/src/client/theme/ui/ProgressBar/index.ts +0 -1
  240. package/src/client/theme/ui/SearchDialog/SearchDialog.tsx +0 -209
  241. package/src/client/theme/ui/SearchDialog/index.ts +0 -1
  242. package/src/client/theme/ui/SearchDialog/search.css +0 -152
  243. package/src/client/theme/ui/Sidebar/Sidebar.tsx +0 -244
  244. package/src/client/theme/ui/Sidebar/index.ts +0 -1
  245. package/src/client/theme/ui/Sidebar/sidebar.css +0 -230
  246. package/src/client/theme/ui/ThemeToggle/ThemeToggle.tsx +0 -69
  247. package/src/client/theme/ui/ThemeToggle/index.ts +0 -1
  248. package/src/client/theme/ui/VersionSwitcher/VersionSwitcher.tsx +0 -136
  249. package/src/client/theme/ui/VersionSwitcher/index.ts +0 -1
  250. package/src/client/utils.ts +0 -49
@@ -1,6 +0,0 @@
1
- import {
2
- Video
3
- } from "./chunk-Z7JHYNAS.mjs";
4
- export {
5
- Video
6
- };
@@ -1,12 +0,0 @@
1
- import {
2
- AssetCache,
3
- FileCache,
4
- TransformCache,
5
- flushCache
6
- } from "./chunk-FFBNU6IJ.mjs";
7
- export {
8
- AssetCache,
9
- FileCache,
10
- TransformCache,
11
- flushCache
12
- };
@@ -1,211 +0,0 @@
1
- // src/client/theme/icons/npm.tsx
2
- import { jsx, jsxs } from "react/jsx-runtime";
3
- var NPM = (props) => /* @__PURE__ */ jsxs("svg", { ...props, viewBox: "0 0 2500 2500", children: [
4
- /* @__PURE__ */ jsx("path", { fill: "#c00", d: "M0 0h2500v2500H0z" }),
5
- /* @__PURE__ */ jsx(
6
- "path",
7
- {
8
- fill: "#fff",
9
- d: "M1241.5 268.5h-973v1962.9h972.9V763.5h495v1467.9h495V268.5z"
10
- }
11
- )
12
- ] });
13
-
14
- // src/client/theme/icons/pnpm.tsx
15
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
16
- var Pnpm = (props) => /* @__PURE__ */ jsxs2(
17
- "svg",
18
- {
19
- ...props,
20
- xmlnsXlink: "http://www.w3.org/1999/xlink",
21
- viewBox: "76.58987244897958 44 164.00775510204068 164",
22
- children: [
23
- /* @__PURE__ */ jsxs2("defs", { children: [
24
- /* @__PURE__ */ jsx2(
25
- "path",
26
- {
27
- d: "M237.6 95L187.6 95L187.6 45L237.6 45L237.6 95Z",
28
- id: "pnpm_dark__b45vdTD8hs"
29
- }
30
- ),
31
- /* @__PURE__ */ jsx2(
32
- "path",
33
- {
34
- d: "M182.59 95L132.59 95L132.59 45L182.59 45L182.59 95Z",
35
- id: "pnpm_dark__a40WtxIl8d"
36
- }
37
- ),
38
- /* @__PURE__ */ jsx2(
39
- "path",
40
- {
41
- d: "M127.59 95L77.59 95L77.59 45L127.59 45L127.59 95Z",
42
- id: "pnpm_dark__h2CN9AEEpe"
43
- }
44
- ),
45
- /* @__PURE__ */ jsx2(
46
- "path",
47
- {
48
- d: "M237.6 150L187.6 150L187.6 100L237.6 100L237.6 150Z",
49
- id: "pnpm_dark__dqv5133G8"
50
- }
51
- ),
52
- /* @__PURE__ */ jsx2(
53
- "path",
54
- {
55
- d: "M182.59 150L132.59 150L132.59 100L182.59 100L182.59 150Z",
56
- id: "pnpm_dark__b1Lv79ypvm"
57
- }
58
- ),
59
- /* @__PURE__ */ jsx2(
60
- "path",
61
- {
62
- d: "M182.59 205L132.59 205L132.59 155L182.59 155L182.59 205Z",
63
- id: "pnpm_dark__hy1IZWwLX"
64
- }
65
- ),
66
- /* @__PURE__ */ jsx2(
67
- "path",
68
- {
69
- d: "M237.6 205L187.6 205L187.6 155L237.6 155L237.6 205Z",
70
- id: "pnpm_dark__akQfjxQes"
71
- }
72
- ),
73
- /* @__PURE__ */ jsx2(
74
- "path",
75
- {
76
- d: "M127.59 205L77.59 205L77.59 155L127.59 155L127.59 205Z",
77
- id: "pnpm_dark__bdSrwE5pk"
78
- }
79
- )
80
- ] }),
81
- /* @__PURE__ */ jsxs2("g", { children: [
82
- /* @__PURE__ */ jsx2("g", { children: /* @__PURE__ */ jsx2("use", { xlinkHref: "#pnpm_dark__b45vdTD8hs", fill: "#f9ad00" }) }),
83
- /* @__PURE__ */ jsx2("g", { children: /* @__PURE__ */ jsx2("use", { xlinkHref: "#pnpm_dark__a40WtxIl8d", fill: "#f9ad00" }) }),
84
- /* @__PURE__ */ jsx2("g", { children: /* @__PURE__ */ jsx2("use", { xlinkHref: "#pnpm_dark__h2CN9AEEpe", fill: "#f9ad00" }) }),
85
- /* @__PURE__ */ jsx2("g", { children: /* @__PURE__ */ jsx2("use", { xlinkHref: "#pnpm_dark__dqv5133G8", fill: "#f9ad00" }) }),
86
- /* @__PURE__ */ jsx2("g", { children: /* @__PURE__ */ jsx2("use", { xlinkHref: "#pnpm_dark__b1Lv79ypvm", fill: "#ffffff" }) }),
87
- /* @__PURE__ */ jsx2("g", { children: /* @__PURE__ */ jsx2("use", { xlinkHref: "#pnpm_dark__hy1IZWwLX", fill: "#ffffff" }) }),
88
- /* @__PURE__ */ jsx2("g", { children: /* @__PURE__ */ jsx2("use", { xlinkHref: "#pnpm_dark__akQfjxQes", fill: "#ffffff" }) }),
89
- /* @__PURE__ */ jsx2("g", { children: /* @__PURE__ */ jsx2("use", { xlinkHref: "#pnpm_dark__bdSrwE5pk", fill: "#ffffff" }) })
90
- ] })
91
- ]
92
- }
93
- );
94
-
95
- // src/client/theme/icons/bun.tsx
96
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
97
- var Bun = (props) => /* @__PURE__ */ jsxs3("svg", { ...props, viewBox: "0 0 80 70", children: [
98
- /* @__PURE__ */ jsx3("path", { d: "M71.09 20.74c-.16-.17-.33-.34-.5-.5s-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5-.33-.34-.5-.5A26.46 26.46 0 0 1 75.5 35.7c0 16.57-16.82 30.05-37.5 30.05-11.58 0-21.94-4.23-28.83-10.86l.5.5.5.5.5.5.5.5.5.5.5.5.5.5C19.55 65.3 30.14 69.75 42 69.75c20.68 0 37.5-13.48 37.5-30 0-7.06-3.04-13.75-8.41-19.01Z" }),
99
- /* @__PURE__ */ jsx3(
100
- "path",
101
- {
102
- d: "M73 35.7c0 15.21-15.67 27.54-35 27.54S3 50.91 3 35.7C3 26.27 9 17.94 18.22 13S33.18 3 38 3s8.94 4.13 19.78 10C67 17.94 73 26.27 73 35.7Z",
103
- style: { fill: "#fbf0df" }
104
- }
105
- ),
106
- /* @__PURE__ */ jsx3(
107
- "path",
108
- {
109
- d: "M73 35.7a21.67 21.67 0 0 0-.8-5.78c-2.73 33.3-43.35 34.9-59.32 24.94A40 40 0 0 0 38 63.24c19.3 0 35-12.35 35-27.54Z",
110
- style: { fill: "#f6dece" }
111
- }
112
- ),
113
- /* @__PURE__ */ jsx3(
114
- "path",
115
- {
116
- d: "M24.53 11.17C29 8.49 34.94 3.46 40.78 3.45A9.29 9.29 0 0 0 38 3c-2.42 0-5 1.25-8.25 3.13-1.13.66-2.3 1.39-3.54 2.15-2.33 1.44-5 3.07-8 4.7C8.69 18.13 3 26.62 3 35.7v1.19c6.06-21.41 17.07-23.04 21.53-25.72Z",
117
- style: { fill: "#fffefc" }
118
- }
119
- ),
120
- /* @__PURE__ */ jsx3(
121
- "path",
122
- {
123
- d: "M35.12 5.53A16.41 16.41 0 0 1 29.49 18c-.28.25-.06.73.3.59 3.37-1.31 7.92-5.23 6-13.14-.08-.45-.67-.33-.67.08Zm2.27 0A16.24 16.24 0 0 1 39 19c-.12.35.31.65.55.36 2.19-2.8 4.1-8.36-1.62-14.36-.29-.26-.74.14-.54.49Zm2.76-.17A16.42 16.42 0 0 1 47 17.12a.33.33 0 0 0 .65.11c.92-3.49.4-9.44-7.17-12.53-.4-.16-.66.38-.33.62Zm-18.46 10.4a16.94 16.94 0 0 0 10.47-9c.18-.36.75-.22.66.18-1.73 8-7.52 9.67-11.12 9.45-.38.01-.37-.52-.01-.63Z",
124
- style: { fill: "#ccbea7", fillRule: "evenodd" }
125
- }
126
- ),
127
- /* @__PURE__ */ jsx3("path", { d: "M38 65.75C17.32 65.75.5 52.27.5 35.7c0-10 6.18-19.33 16.53-24.92 3-1.6 5.57-3.21 7.86-4.62 1.26-.78 2.45-1.51 3.6-2.19C32 1.89 35 .5 38 .5s5.62 1.2 8.9 3.14c1 .57 2 1.19 3.07 1.87 2.49 1.54 5.3 3.28 9 5.27C69.32 16.37 75.5 25.69 75.5 35.7c0 16.57-16.82 30.05-37.5 30.05ZM38 3c-2.42 0-5 1.25-8.25 3.13-1.13.66-2.3 1.39-3.54 2.15-2.33 1.44-5 3.07-8 4.7C8.69 18.13 3 26.62 3 35.7c0 15.19 15.7 27.55 35 27.55S73 50.89 73 35.7c0-9.08-5.69-17.57-15.22-22.7-3.78-2-6.73-3.88-9.12-5.36-1.09-.67-2.09-1.29-3-1.84C42.63 4 40.42 3 38 3Z" }),
128
- /* @__PURE__ */ jsxs3("g", { children: [
129
- /* @__PURE__ */ jsx3(
130
- "path",
131
- {
132
- d: "M45.05 43a8.93 8.93 0 0 1-2.92 4.71 6.81 6.81 0 0 1-4 1.88A6.84 6.84 0 0 1 34 47.71 8.93 8.93 0 0 1 31.12 43a.72.72 0 0 1 .8-.81h12.34a.72.72 0 0 1 .79.81Z",
133
- style: { fill: "#b71422" }
134
- }
135
- ),
136
- /* @__PURE__ */ jsx3(
137
- "path",
138
- {
139
- d: "M34 47.79a6.91 6.91 0 0 0 4.12 1.9 6.91 6.91 0 0 0 4.11-1.9 10.63 10.63 0 0 0 1-1.07 6.83 6.83 0 0 0-4.9-2.31 6.15 6.15 0 0 0-5 2.78c.23.21.43.41.67.6Z",
140
- style: { fill: "#ff6164" }
141
- }
142
- ),
143
- /* @__PURE__ */ jsx3("path", { d: "M34.16 47a5.36 5.36 0 0 1 4.19-2.08 6 6 0 0 1 4 1.69c.23-.25.45-.51.66-.77a7 7 0 0 0-4.71-1.93 6.36 6.36 0 0 0-4.89 2.36 9.53 9.53 0 0 0 .75.73Z" }),
144
- /* @__PURE__ */ jsx3("path", { d: "M38.09 50.19a7.42 7.42 0 0 1-4.45-2 9.52 9.52 0 0 1-3.11-5.05 1.2 1.2 0 0 1 .26-1 1.41 1.41 0 0 1 1.13-.51h12.34a1.44 1.44 0 0 1 1.13.51 1.19 1.19 0 0 1 .25 1 9.52 9.52 0 0 1-3.11 5.05 7.42 7.42 0 0 1-4.44 2Zm-6.17-7.4c-.16 0-.2.07-.21.09a8.29 8.29 0 0 0 2.73 4.37A6.23 6.23 0 0 0 38.09 49a6.28 6.28 0 0 0 3.65-1.73 8.3 8.3 0 0 0 2.72-4.37.21.21 0 0 0-.2-.09Z" })
145
- ] }),
146
- /* @__PURE__ */ jsxs3("g", { children: [
147
- /* @__PURE__ */ jsx3(
148
- "ellipse",
149
- {
150
- cx: "53.22",
151
- cy: "40.18",
152
- rx: "5.85",
153
- ry: "3.44",
154
- style: { fill: "#febbd0" }
155
- }
156
- ),
157
- /* @__PURE__ */ jsx3(
158
- "ellipse",
159
- {
160
- cx: "22.95",
161
- cy: "40.18",
162
- rx: "5.85",
163
- ry: "3.44",
164
- style: { fill: "#febbd0" }
165
- }
166
- ),
167
- /* @__PURE__ */ jsx3(
168
- "path",
169
- {
170
- d: "M25.7 38.8a5.51 5.51 0 1 0-5.5-5.51 5.51 5.51 0 0 0 5.5 5.51Zm24.77 0A5.51 5.51 0 1 0 45 33.29a5.5 5.5 0 0 0 5.47 5.51Z",
171
- style: { fillRule: "evenodd" }
172
- }
173
- ),
174
- /* @__PURE__ */ jsx3(
175
- "path",
176
- {
177
- d: "M24 33.64a2.07 2.07 0 1 0-2.06-2.07A2.07 2.07 0 0 0 24 33.64Zm24.77 0a2.07 2.07 0 1 0-2.06-2.07 2.07 2.07 0 0 0 2.04 2.07Z",
178
- style: { fill: "#fff", fillRule: "evenodd" }
179
- }
180
- )
181
- ] })
182
- ] });
183
-
184
- // src/client/theme/icons/deno.tsx
185
- import { jsx as jsx4 } from "react/jsx-runtime";
186
- var Deno = (props) => /* @__PURE__ */ jsx4(
187
- "svg",
188
- {
189
- ...props,
190
- xmlSpace: "preserve",
191
- fillRule: "evenodd",
192
- strokeLinejoin: "round",
193
- strokeMiterlimit: "2",
194
- clipRule: "evenodd",
195
- viewBox: "0 0 441 441",
196
- children: /* @__PURE__ */ jsx4(
197
- "path",
198
- {
199
- fill: "currentColor",
200
- d: "M229.858-2.62c121.29 5.675 215.154 108.755 209.479 230.045S330.582 442.578 209.292 436.903-5.863 328.149-.188 206.859 108.568-8.296 229.858-2.62Zm51.365 264.922c-13.886-.687-27.594-3.012-38.616-4.857-8.381-1.404-16.33-3.616-22.855-5.858a2.576 2.576 0 0 0-2.932.878c-.678.905-.777 2.22-.02 3.061 3.08 3.418 12.848 10.54 20.439 13.812-6.491 5.357-10.933 17.608-12.684 23.95-2.35 8.51-2.687 20.801-2.12 25.312 2.282 18.146 8.95 34.41 25.467 48.64 11.562 9.96 28.295 16.77 45.399 17.08 23.603.426 51.882-9.705 74.085-32.493 29.028-31.807 48.051-73.17 51.593-119.393 8.434-110.06-74.073-206.264-184.134-214.698C124.785 9.302 28.582 91.81 20.147 201.87c-4.368 56.998 15.655 110.28 51.267 149.576a3.185 3.185 0 0 0 5.422-2.974c-26.39-103.487 30.95-215.162 94.926-250.494 23.751-13.118 46.884-18.1 67.664-9.69 31.814 12.874 50 34.21 89.375 52.163 39.375 17.951 43.625 47.862 32.64 78.098-10.986 30.236-46.358 45.425-80.218 43.753Zm-68.863-160.08c-12.906 1.006-21.384 16.978-22.497 27.253-1.117 10.275 3.978 27.236 20.794 26.91 19.694-.383 25.681-17.238 23.525-33.55-1.618-12.25-11.033-21.456-21.822-20.613Z"
201
- }
202
- )
203
- }
204
- );
205
-
206
- export {
207
- NPM,
208
- Pnpm,
209
- Bun,
210
- Deno
211
- };
@@ -1,386 +0,0 @@
1
- // src/node/cache.ts
2
- import fs2 from "fs";
3
- import path from "path";
4
- import crypto from "crypto";
5
- import zlib from "zlib";
6
- import { promisify } from "util";
7
-
8
- // src/node/utils.ts
9
- import fs from "fs";
10
- import matter from "gray-matter";
11
- function normalizePath(p) {
12
- return p.replace(/\\/g, "/");
13
- }
14
- function stripNumberPrefix(name) {
15
- return name.replace(/^\d+\./, "");
16
- }
17
- function extractNumberPrefix(name) {
18
- const match = name.match(/^(\d+)\./);
19
- return match ? parseInt(match[1], 10) : void 0;
20
- }
21
- function isDocFile(filePath) {
22
- return /\.mdx?$/.test(filePath);
23
- }
24
- function getFileMtime(filePath) {
25
- try {
26
- return fs.statSync(filePath).mtimeMs;
27
- } catch {
28
- return 0;
29
- }
30
- }
31
- function parseFrontmatter(filePath) {
32
- const raw = fs.readFileSync(filePath, "utf-8");
33
- const { data, content } = matter(raw);
34
- return { data, content };
35
- }
36
- function escapeHtml(str) {
37
- return str.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/'/g, "&apos;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
38
- }
39
- function escapeXml(str) {
40
- return escapeHtml(str);
41
- }
42
- function fileToRoutePath(relativePath) {
43
- let cleanedPath = relativePath.split("/").map(stripNumberPrefix).join("/");
44
- let routePath = cleanedPath.replace(/\/$/, "");
45
- routePath = routePath.replace(/\.mdx?$/, "");
46
- if (routePath === "index" || routePath.endsWith("/index")) {
47
- routePath = routePath.replace(/index$/, "");
48
- }
49
- if (!routePath.startsWith("/")) {
50
- routePath = "/" + routePath;
51
- }
52
- if (routePath.length > 1 && routePath.endsWith("/")) {
53
- routePath = routePath.slice(0, -1);
54
- }
55
- return routePath;
56
- }
57
- function capitalize(str) {
58
- return str.charAt(0).toUpperCase() + str.slice(1);
59
- }
60
-
61
- // src/node/cache.ts
62
- var writeFile = promisify(fs2.writeFile);
63
- var readFile = promisify(fs2.readFile);
64
- var mkdir = promisify(fs2.mkdir);
65
- var rename = promisify(fs2.rename);
66
- var unlink = promisify(fs2.unlink);
67
- var CACHE_DIR = process.env.BOLTDOCS_CACHE_DIR || ".boltdocs";
68
- var ASSETS_DIR = "assets";
69
- var SHARDS_DIR = "shards";
70
- var DEFAULT_LRU_LIMIT = parseInt(
71
- process.env.BOLTDOCS_CACHE_LRU_LIMIT || "2000",
72
- 10
73
- );
74
- var DEFAULT_COMPRESS = process.env.BOLTDOCS_CACHE_COMPRESS !== "0";
75
- var LRUCache = class {
76
- constructor(limit) {
77
- this.limit = limit;
78
- }
79
- cache = /* @__PURE__ */ new Map();
80
- get(key) {
81
- const val = this.cache.get(key);
82
- if (val !== void 0) {
83
- this.cache.delete(key);
84
- this.cache.set(key, val);
85
- }
86
- return val;
87
- }
88
- set(key, value) {
89
- if (this.cache.has(key)) {
90
- this.cache.delete(key);
91
- } else if (this.cache.size >= this.limit) {
92
- const firstKey = this.cache.keys().next().value;
93
- if (firstKey !== void 0) {
94
- this.cache.delete(firstKey);
95
- }
96
- }
97
- this.cache.set(key, value);
98
- }
99
- get size() {
100
- return this.cache.size;
101
- }
102
- clear() {
103
- this.cache.clear();
104
- }
105
- };
106
- var BackgroundQueue = class {
107
- queue = Promise.resolve();
108
- pendingCount = 0;
109
- add(task) {
110
- this.pendingCount++;
111
- this.queue = this.queue.then(task).finally(() => {
112
- this.pendingCount--;
113
- });
114
- }
115
- async flush() {
116
- await this.queue;
117
- }
118
- get pending() {
119
- return this.pendingCount;
120
- }
121
- };
122
- var backgroundQueue = new BackgroundQueue();
123
- var FileCache = class {
124
- entries = /* @__PURE__ */ new Map();
125
- cachePath = null;
126
- compress;
127
- constructor(options = {}) {
128
- this.compress = options.compress !== void 0 ? options.compress : DEFAULT_COMPRESS;
129
- if (options.name) {
130
- const root = options.root || process.cwd();
131
- const ext = this.compress ? "json.gz" : "json";
132
- this.cachePath = path.resolve(root, CACHE_DIR, `${options.name}.${ext}`);
133
- }
134
- }
135
- /**
136
- * Loads the cache. Synchronous for startup simplicity but uses fast I/O.
137
- */
138
- load() {
139
- if (process.env.BOLTDOCS_NO_CACHE === "1") return;
140
- if (!this.cachePath || !fs2.existsSync(this.cachePath)) return;
141
- try {
142
- let raw = fs2.readFileSync(this.cachePath);
143
- if (this.cachePath.endsWith(".gz")) {
144
- raw = zlib.gunzipSync(raw);
145
- }
146
- const data = JSON.parse(raw.toString("utf-8"));
147
- this.entries = new Map(Object.entries(data));
148
- } catch (e) {
149
- }
150
- }
151
- /**
152
- * Saves the cache in the background.
153
- */
154
- save() {
155
- if (process.env.BOLTDOCS_NO_CACHE === "1") return;
156
- if (!this.cachePath) return;
157
- const data = Object.fromEntries(this.entries);
158
- const content = JSON.stringify(data);
159
- const target = this.cachePath;
160
- const useCompress = this.compress;
161
- backgroundQueue.add(async () => {
162
- try {
163
- await mkdir(path.dirname(target), { recursive: true });
164
- let buffer = Buffer.from(content);
165
- if (useCompress) {
166
- buffer = zlib.gzipSync(buffer);
167
- }
168
- const tempPath = `${target}.${crypto.randomBytes(4).toString("hex")}.tmp`;
169
- await writeFile(tempPath, buffer);
170
- await rename(tempPath, target);
171
- } catch (e) {
172
- }
173
- });
174
- }
175
- get(filePath) {
176
- const entry = this.entries.get(filePath);
177
- if (!entry) return null;
178
- if (getFileMtime(filePath) !== entry.mtime) return null;
179
- return entry.data;
180
- }
181
- set(filePath, data) {
182
- this.entries.set(filePath, {
183
- data,
184
- mtime: getFileMtime(filePath)
185
- });
186
- }
187
- isValid(filePath) {
188
- const entry = this.entries.get(filePath);
189
- if (!entry) return false;
190
- return getFileMtime(filePath) === entry.mtime;
191
- }
192
- invalidate(filePath) {
193
- this.entries.delete(filePath);
194
- }
195
- invalidateAll() {
196
- this.entries.clear();
197
- }
198
- pruneStale(currentFiles) {
199
- for (const key of this.entries.keys()) {
200
- if (!currentFiles.has(key)) {
201
- this.entries.delete(key);
202
- }
203
- }
204
- }
205
- get size() {
206
- return this.entries.size;
207
- }
208
- async flush() {
209
- await backgroundQueue.flush();
210
- }
211
- };
212
- var TransformCache = class {
213
- index = /* @__PURE__ */ new Map();
214
- // key -> hash
215
- memoryCache = new LRUCache(DEFAULT_LRU_LIMIT);
216
- baseDir;
217
- shardsDir;
218
- indexPath;
219
- constructor(name, root = process.cwd()) {
220
- this.baseDir = path.resolve(root, CACHE_DIR, `transform-${name}`);
221
- this.shardsDir = path.resolve(this.baseDir, SHARDS_DIR);
222
- this.indexPath = path.resolve(this.baseDir, "index.json");
223
- }
224
- /**
225
- * Loads the index into memory.
226
- */
227
- load() {
228
- if (process.env.BOLTDOCS_NO_CACHE === "1") return;
229
- if (!fs2.existsSync(this.indexPath)) return;
230
- try {
231
- const data = fs2.readFileSync(this.indexPath, "utf-8");
232
- this.index = new Map(Object.entries(JSON.parse(data)));
233
- } catch (e) {
234
- }
235
- }
236
- /**
237
- * Persists the index in background.
238
- */
239
- save() {
240
- if (process.env.BOLTDOCS_NO_CACHE === "1") return;
241
- const data = JSON.stringify(Object.fromEntries(this.index));
242
- const target = this.indexPath;
243
- backgroundQueue.add(async () => {
244
- await mkdir(path.dirname(target), { recursive: true });
245
- await writeFile(target, data);
246
- });
247
- }
248
- /**
249
- * Batch Read: Retrieves multiple transformation results concurrently.
250
- */
251
- async getMany(keys) {
252
- const results = /* @__PURE__ */ new Map();
253
- const toLoad = [];
254
- for (const key of keys) {
255
- const mem = this.memoryCache.get(key);
256
- if (mem) results.set(key, mem);
257
- else if (this.index.has(key)) toLoad.push(key);
258
- }
259
- if (toLoad.length > 0) {
260
- const shards = await Promise.all(
261
- toLoad.map(async (key) => {
262
- const hash = this.index.get(key);
263
- const shardPath = path.resolve(this.shardsDir, `${hash}.gz`);
264
- try {
265
- const compressed = await readFile(shardPath);
266
- const decompressed = zlib.gunzipSync(compressed).toString("utf-8");
267
- this.memoryCache.set(key, decompressed);
268
- return { key, val: decompressed };
269
- } catch (e) {
270
- return null;
271
- }
272
- })
273
- );
274
- for (const s of shards) {
275
- if (s) results.set(s.key, s.val);
276
- }
277
- }
278
- return results;
279
- }
280
- /**
281
- * Retrieves a cached transformation. Fast lookup via index, lazy loading from disk.
282
- */
283
- get(key) {
284
- const mem = this.memoryCache.get(key);
285
- if (mem) return mem;
286
- const hash = this.index.get(key);
287
- if (!hash) return null;
288
- const shardPath = path.resolve(this.shardsDir, `${hash}.gz`);
289
- if (!fs2.existsSync(shardPath)) return null;
290
- try {
291
- const compressed = fs2.readFileSync(shardPath);
292
- const decompressed = zlib.gunzipSync(compressed).toString("utf-8");
293
- this.memoryCache.set(key, decompressed);
294
- return decompressed;
295
- } catch (e) {
296
- return null;
297
- }
298
- }
299
- /**
300
- * Stores a transformation result.
301
- */
302
- set(key, result) {
303
- const hash = crypto.createHash("md5").update(result).digest("hex");
304
- this.index.set(key, hash);
305
- this.memoryCache.set(key, result);
306
- const shardPath = path.resolve(this.shardsDir, `${hash}.gz`);
307
- backgroundQueue.add(async () => {
308
- if (fs2.existsSync(shardPath)) return;
309
- await mkdir(this.shardsDir, { recursive: true });
310
- const compressed = zlib.gzipSync(Buffer.from(result));
311
- const tempPath = `${shardPath}.${crypto.randomBytes(4).toString("hex")}.tmp`;
312
- await writeFile(tempPath, compressed);
313
- await rename(tempPath, shardPath);
314
- });
315
- }
316
- get size() {
317
- return this.index.size;
318
- }
319
- async flush() {
320
- await backgroundQueue.flush();
321
- }
322
- };
323
- var AssetCache = class {
324
- assetsDir;
325
- constructor(root = process.cwd()) {
326
- this.assetsDir = path.resolve(root, CACHE_DIR, ASSETS_DIR);
327
- }
328
- getFileHash(filePath) {
329
- return crypto.createHash("md5").update(fs2.readFileSync(filePath)).digest("hex");
330
- }
331
- get(sourcePath, cacheKey) {
332
- if (!fs2.existsSync(sourcePath)) return null;
333
- const sourceHash = this.getFileHash(sourcePath);
334
- const cachedPath = this.getCachedPath(
335
- sourcePath,
336
- `${cacheKey}-${sourceHash}`
337
- );
338
- return fs2.existsSync(cachedPath) ? cachedPath : null;
339
- }
340
- set(sourcePath, cacheKey, content) {
341
- const sourceHash = this.getFileHash(sourcePath);
342
- const cachedPath = this.getCachedPath(
343
- sourcePath,
344
- `${cacheKey}-${sourceHash}`
345
- );
346
- backgroundQueue.add(async () => {
347
- await mkdir(this.assetsDir, { recursive: true });
348
- const tempPath = `${cachedPath}.${crypto.randomBytes(4).toString("hex")}.tmp`;
349
- await writeFile(tempPath, content);
350
- await rename(tempPath, cachedPath);
351
- });
352
- }
353
- getCachedPath(sourcePath, cacheKey) {
354
- const ext = path.extname(sourcePath);
355
- const name = path.basename(sourcePath, ext);
356
- const safeKey = cacheKey.replace(/[^a-z0-9]/gi, "-").toLowerCase();
357
- return path.join(this.assetsDir, `${name}.${safeKey}${ext}`);
358
- }
359
- clear() {
360
- if (fs2.existsSync(this.assetsDir)) {
361
- fs2.rmSync(this.assetsDir, { recursive: true, force: true });
362
- }
363
- }
364
- async flush() {
365
- await backgroundQueue.flush();
366
- }
367
- };
368
- async function flushCache() {
369
- await backgroundQueue.flush();
370
- }
371
-
372
- export {
373
- normalizePath,
374
- stripNumberPrefix,
375
- extractNumberPrefix,
376
- isDocFile,
377
- parseFrontmatter,
378
- escapeHtml,
379
- escapeXml,
380
- fileToRoutePath,
381
- capitalize,
382
- FileCache,
383
- TransformCache,
384
- AssetCache,
385
- flushCache
386
- };
@@ -1,37 +0,0 @@
1
- // src/client/utils.ts
2
- async function getStarsRepo(repo) {
3
- const response = await fetch(`https://api.github.com/repos/${repo}`);
4
- const data = await response.json();
5
- if (data.stargazers_count !== void 0) {
6
- return formatStars(data.stargazers_count);
7
- } else {
8
- return "0";
9
- }
10
- }
11
- var formatStars = (count) => {
12
- return Intl.NumberFormat("en", {
13
- notation: "compact",
14
- compactDisplay: "short"
15
- }).format(count);
16
- };
17
- var copyToClipboard = async (text) => {
18
- try {
19
- await navigator.clipboard.writeText(text);
20
- return true;
21
- } catch {
22
- const textarea = document.createElement("textarea");
23
- textarea.value = text;
24
- textarea.style.position = "fixed";
25
- textarea.style.opacity = "0";
26
- document.body.appendChild(textarea);
27
- textarea.select();
28
- document.execCommand("copy");
29
- document.body.removeChild(textarea);
30
- return true;
31
- }
32
- };
33
-
34
- export {
35
- getStarsRepo,
36
- copyToClipboard
37
- };