jamdesk 1.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 (435) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +323 -0
  3. package/bin/jamdesk.js +76 -0
  4. package/dist/__tests__/integration/deprecated-components.integration.test.d.ts +8 -0
  5. package/dist/__tests__/integration/deprecated-components.integration.test.d.ts.map +1 -0
  6. package/dist/__tests__/integration/deprecated-components.integration.test.js +165 -0
  7. package/dist/__tests__/integration/deprecated-components.integration.test.js.map +1 -0
  8. package/dist/__tests__/integration/migrate.integration.test.d.ts +2 -0
  9. package/dist/__tests__/integration/migrate.integration.test.d.ts.map +1 -0
  10. package/dist/__tests__/integration/migrate.integration.test.js +64 -0
  11. package/dist/__tests__/integration/migrate.integration.test.js.map +1 -0
  12. package/dist/__tests__/integration/prepublish.integration.test.d.ts +2 -0
  13. package/dist/__tests__/integration/prepublish.integration.test.d.ts.map +1 -0
  14. package/dist/__tests__/integration/prepublish.integration.test.js +27 -0
  15. package/dist/__tests__/integration/prepublish.integration.test.js.map +1 -0
  16. package/dist/__tests__/integration/validate.integration.test.d.ts +2 -0
  17. package/dist/__tests__/integration/validate.integration.test.d.ts.map +1 -0
  18. package/dist/__tests__/integration/validate.integration.test.js +56 -0
  19. package/dist/__tests__/integration/validate.integration.test.js.map +1 -0
  20. package/dist/__tests__/unit/deploy-templates.test.d.ts +2 -0
  21. package/dist/__tests__/unit/deploy-templates.test.d.ts.map +1 -0
  22. package/dist/__tests__/unit/deploy-templates.test.js +124 -0
  23. package/dist/__tests__/unit/deploy-templates.test.js.map +1 -0
  24. package/dist/__tests__/unit/deprecated-components-sync.test.d.ts +2 -0
  25. package/dist/__tests__/unit/deprecated-components-sync.test.d.ts.map +1 -0
  26. package/dist/__tests__/unit/deprecated-components-sync.test.js +69 -0
  27. package/dist/__tests__/unit/deprecated-components-sync.test.js.map +1 -0
  28. package/dist/__tests__/unit/deps-sync.test.d.ts +14 -0
  29. package/dist/__tests__/unit/deps-sync.test.d.ts.map +1 -0
  30. package/dist/__tests__/unit/deps-sync.test.js +166 -0
  31. package/dist/__tests__/unit/deps-sync.test.js.map +1 -0
  32. package/dist/__tests__/unit/docs-config.test.d.ts +2 -0
  33. package/dist/__tests__/unit/docs-config.test.d.ts.map +1 -0
  34. package/dist/__tests__/unit/docs-config.test.js +288 -0
  35. package/dist/__tests__/unit/docs-config.test.js.map +1 -0
  36. package/dist/__tests__/unit/errors.test.d.ts +2 -0
  37. package/dist/__tests__/unit/errors.test.d.ts.map +1 -0
  38. package/dist/__tests__/unit/errors.test.js +27 -0
  39. package/dist/__tests__/unit/errors.test.js.map +1 -0
  40. package/dist/__tests__/unit/extract-hooks.test.d.ts +5 -0
  41. package/dist/__tests__/unit/extract-hooks.test.d.ts.map +1 -0
  42. package/dist/__tests__/unit/extract-hooks.test.js +205 -0
  43. package/dist/__tests__/unit/extract-hooks.test.js.map +1 -0
  44. package/dist/__tests__/unit/frontmatter-sync.test.d.ts +8 -0
  45. package/dist/__tests__/unit/frontmatter-sync.test.d.ts.map +1 -0
  46. package/dist/__tests__/unit/frontmatter-sync.test.js +26 -0
  47. package/dist/__tests__/unit/frontmatter-sync.test.js.map +1 -0
  48. package/dist/__tests__/unit/mdx-validator.test.d.ts +2 -0
  49. package/dist/__tests__/unit/mdx-validator.test.d.ts.map +1 -0
  50. package/dist/__tests__/unit/mdx-validator.test.js +264 -0
  51. package/dist/__tests__/unit/mdx-validator.test.js.map +1 -0
  52. package/dist/__tests__/unit/migrate-convert.test.d.ts +2 -0
  53. package/dist/__tests__/unit/migrate-convert.test.d.ts.map +1 -0
  54. package/dist/__tests__/unit/migrate-convert.test.js +297 -0
  55. package/dist/__tests__/unit/migrate-convert.test.js.map +1 -0
  56. package/dist/__tests__/unit/migrate-detect.test.d.ts +2 -0
  57. package/dist/__tests__/unit/migrate-detect.test.d.ts.map +1 -0
  58. package/dist/__tests__/unit/migrate-detect.test.js +35 -0
  59. package/dist/__tests__/unit/migrate-detect.test.js.map +1 -0
  60. package/dist/__tests__/unit/migrate-mdx.test.d.ts +2 -0
  61. package/dist/__tests__/unit/migrate-mdx.test.d.ts.map +1 -0
  62. package/dist/__tests__/unit/migrate-mdx.test.js +158 -0
  63. package/dist/__tests__/unit/migrate-mdx.test.js.map +1 -0
  64. package/dist/__tests__/unit/openapi.test.d.ts +2 -0
  65. package/dist/__tests__/unit/openapi.test.d.ts.map +1 -0
  66. package/dist/__tests__/unit/openapi.test.js +52 -0
  67. package/dist/__tests__/unit/openapi.test.js.map +1 -0
  68. package/dist/__tests__/unit/package-config.test.d.ts +2 -0
  69. package/dist/__tests__/unit/package-config.test.d.ts.map +1 -0
  70. package/dist/__tests__/unit/package-config.test.js +63 -0
  71. package/dist/__tests__/unit/package-config.test.js.map +1 -0
  72. package/dist/__tests__/unit/port.test.d.ts +2 -0
  73. package/dist/__tests__/unit/port.test.d.ts.map +1 -0
  74. package/dist/__tests__/unit/port.test.js +20 -0
  75. package/dist/__tests__/unit/port.test.js.map +1 -0
  76. package/dist/__tests__/unit/vendored-sync.test.d.ts +14 -0
  77. package/dist/__tests__/unit/vendored-sync.test.d.ts.map +1 -0
  78. package/dist/__tests__/unit/vendored-sync.test.js +90 -0
  79. package/dist/__tests__/unit/vendored-sync.test.js.map +1 -0
  80. package/dist/commands/broken-links.d.ts +11 -0
  81. package/dist/commands/broken-links.d.ts.map +1 -0
  82. package/dist/commands/broken-links.js +95 -0
  83. package/dist/commands/broken-links.js.map +1 -0
  84. package/dist/commands/clean.d.ts +7 -0
  85. package/dist/commands/clean.d.ts.map +1 -0
  86. package/dist/commands/clean.js +59 -0
  87. package/dist/commands/clean.js.map +1 -0
  88. package/dist/commands/deploy/cloudflare.d.ts +12 -0
  89. package/dist/commands/deploy/cloudflare.d.ts.map +1 -0
  90. package/dist/commands/deploy/cloudflare.js +409 -0
  91. package/dist/commands/deploy/cloudflare.js.map +1 -0
  92. package/dist/commands/deploy/templates.d.ts +23 -0
  93. package/dist/commands/deploy/templates.d.ts.map +1 -0
  94. package/dist/commands/deploy/templates.js +179 -0
  95. package/dist/commands/deploy/templates.js.map +1 -0
  96. package/dist/commands/deploy/types.d.ts +19 -0
  97. package/dist/commands/deploy/types.d.ts.map +1 -0
  98. package/dist/commands/deploy/types.js +5 -0
  99. package/dist/commands/deploy/types.js.map +1 -0
  100. package/dist/commands/dev.d.ts +14 -0
  101. package/dist/commands/dev.d.ts.map +1 -0
  102. package/dist/commands/dev.js +817 -0
  103. package/dist/commands/dev.js.map +1 -0
  104. package/dist/commands/doctor.d.ts +7 -0
  105. package/dist/commands/doctor.d.ts.map +1 -0
  106. package/dist/commands/doctor.js +159 -0
  107. package/dist/commands/doctor.js.map +1 -0
  108. package/dist/commands/init.d.ts +7 -0
  109. package/dist/commands/init.d.ts.map +1 -0
  110. package/dist/commands/init.js +96 -0
  111. package/dist/commands/init.js.map +1 -0
  112. package/dist/commands/migrate/convert-mdx.d.ts +50 -0
  113. package/dist/commands/migrate/convert-mdx.d.ts.map +1 -0
  114. package/dist/commands/migrate/convert-mdx.js +108 -0
  115. package/dist/commands/migrate/convert-mdx.js.map +1 -0
  116. package/dist/commands/migrate/convert.d.ts +80 -0
  117. package/dist/commands/migrate/convert.d.ts.map +1 -0
  118. package/dist/commands/migrate/convert.js +158 -0
  119. package/dist/commands/migrate/convert.js.map +1 -0
  120. package/dist/commands/migrate/detect.d.ts +31 -0
  121. package/dist/commands/migrate/detect.d.ts.map +1 -0
  122. package/dist/commands/migrate/detect.js +62 -0
  123. package/dist/commands/migrate/detect.js.map +1 -0
  124. package/dist/commands/migrate/extract-hooks.d.ts +71 -0
  125. package/dist/commands/migrate/extract-hooks.d.ts.map +1 -0
  126. package/dist/commands/migrate/extract-hooks.js +473 -0
  127. package/dist/commands/migrate/extract-hooks.js.map +1 -0
  128. package/dist/commands/migrate/index.d.ts +17 -0
  129. package/dist/commands/migrate/index.d.ts.map +1 -0
  130. package/dist/commands/migrate/index.js +282 -0
  131. package/dist/commands/migrate/index.js.map +1 -0
  132. package/dist/commands/migrate/prompts.d.ts +22 -0
  133. package/dist/commands/migrate/prompts.d.ts.map +1 -0
  134. package/dist/commands/migrate/prompts.js +67 -0
  135. package/dist/commands/migrate/prompts.js.map +1 -0
  136. package/dist/commands/migrate/types.d.ts +22 -0
  137. package/dist/commands/migrate/types.d.ts.map +1 -0
  138. package/dist/commands/migrate/types.js +26 -0
  139. package/dist/commands/migrate/types.js.map +1 -0
  140. package/dist/commands/openapi-check.d.ts +11 -0
  141. package/dist/commands/openapi-check.d.ts.map +1 -0
  142. package/dist/commands/openapi-check.js +88 -0
  143. package/dist/commands/openapi-check.js.map +1 -0
  144. package/dist/commands/rename.d.ts +10 -0
  145. package/dist/commands/rename.d.ts.map +1 -0
  146. package/dist/commands/rename.js +125 -0
  147. package/dist/commands/rename.js.map +1 -0
  148. package/dist/commands/update.d.ts +10 -0
  149. package/dist/commands/update.d.ts.map +1 -0
  150. package/dist/commands/update.js +57 -0
  151. package/dist/commands/update.js.map +1 -0
  152. package/dist/commands/validate.d.ts +12 -0
  153. package/dist/commands/validate.d.ts.map +1 -0
  154. package/dist/commands/validate.js +163 -0
  155. package/dist/commands/validate.js.map +1 -0
  156. package/dist/index.d.ts +9 -0
  157. package/dist/index.d.ts.map +1 -0
  158. package/dist/index.js +334 -0
  159. package/dist/index.js.map +1 -0
  160. package/dist/lib/config.d.ts +7 -0
  161. package/dist/lib/config.d.ts.map +1 -0
  162. package/dist/lib/config.js +18 -0
  163. package/dist/lib/config.js.map +1 -0
  164. package/dist/lib/deprecated-components.d.ts +72 -0
  165. package/dist/lib/deprecated-components.d.ts.map +1 -0
  166. package/dist/lib/deprecated-components.js +138 -0
  167. package/dist/lib/deprecated-components.js.map +1 -0
  168. package/dist/lib/deps.d.ts +17 -0
  169. package/dist/lib/deps.d.ts.map +1 -0
  170. package/dist/lib/deps.js +186 -0
  171. package/dist/lib/deps.js.map +1 -0
  172. package/dist/lib/docs-config.d.ts +67 -0
  173. package/dist/lib/docs-config.d.ts.map +1 -0
  174. package/dist/lib/docs-config.js +294 -0
  175. package/dist/lib/docs-config.js.map +1 -0
  176. package/dist/lib/errors.d.ts +23 -0
  177. package/dist/lib/errors.d.ts.map +1 -0
  178. package/dist/lib/errors.js +32 -0
  179. package/dist/lib/errors.js.map +1 -0
  180. package/dist/lib/frontmatter-utils.d.ts +25 -0
  181. package/dist/lib/frontmatter-utils.d.ts.map +1 -0
  182. package/dist/lib/frontmatter-utils.js +64 -0
  183. package/dist/lib/frontmatter-utils.js.map +1 -0
  184. package/dist/lib/mdx-validator.d.ts +27 -0
  185. package/dist/lib/mdx-validator.d.ts.map +1 -0
  186. package/dist/lib/mdx-validator.js +148 -0
  187. package/dist/lib/mdx-validator.js.map +1 -0
  188. package/dist/lib/navigation-validator.d.ts +31 -0
  189. package/dist/lib/navigation-validator.d.ts.map +1 -0
  190. package/dist/lib/navigation-validator.js +75 -0
  191. package/dist/lib/navigation-validator.js.map +1 -0
  192. package/dist/lib/normalize-config.d.ts +57 -0
  193. package/dist/lib/normalize-config.d.ts.map +1 -0
  194. package/dist/lib/normalize-config.js +63 -0
  195. package/dist/lib/normalize-config.js.map +1 -0
  196. package/dist/lib/openapi/cache.d.ts +40 -0
  197. package/dist/lib/openapi/cache.d.ts.map +1 -0
  198. package/dist/lib/openapi/cache.js +76 -0
  199. package/dist/lib/openapi/cache.js.map +1 -0
  200. package/dist/lib/openapi/errors.d.ts +36 -0
  201. package/dist/lib/openapi/errors.d.ts.map +1 -0
  202. package/dist/lib/openapi/errors.js +162 -0
  203. package/dist/lib/openapi/errors.js.map +1 -0
  204. package/dist/lib/openapi/index.d.ts +10 -0
  205. package/dist/lib/openapi/index.d.ts.map +1 -0
  206. package/dist/lib/openapi/index.js +12 -0
  207. package/dist/lib/openapi/index.js.map +1 -0
  208. package/dist/lib/openapi/types.d.ts +198 -0
  209. package/dist/lib/openapi/types.d.ts.map +1 -0
  210. package/dist/lib/openapi/types.js +8 -0
  211. package/dist/lib/openapi/types.js.map +1 -0
  212. package/dist/lib/openapi/validator.d.ts +45 -0
  213. package/dist/lib/openapi/validator.d.ts.map +1 -0
  214. package/dist/lib/openapi/validator.js +128 -0
  215. package/dist/lib/openapi/validator.js.map +1 -0
  216. package/dist/lib/openapi.d.ts +7 -0
  217. package/dist/lib/openapi.d.ts.map +1 -0
  218. package/dist/lib/openapi.js +7 -0
  219. package/dist/lib/openapi.js.map +1 -0
  220. package/dist/lib/output.d.ts +14 -0
  221. package/dist/lib/output.d.ts.map +1 -0
  222. package/dist/lib/output.js +19 -0
  223. package/dist/lib/output.js.map +1 -0
  224. package/dist/lib/path-security.d.ts +23 -0
  225. package/dist/lib/path-security.d.ts.map +1 -0
  226. package/dist/lib/path-security.js +35 -0
  227. package/dist/lib/path-security.js.map +1 -0
  228. package/dist/lib/port.d.ts +18 -0
  229. package/dist/lib/port.d.ts.map +1 -0
  230. package/dist/lib/port.js +65 -0
  231. package/dist/lib/port.js.map +1 -0
  232. package/dist/lib/spinner.d.ts +4 -0
  233. package/dist/lib/spinner.d.ts.map +1 -0
  234. package/dist/lib/spinner.js +16 -0
  235. package/dist/lib/spinner.js.map +1 -0
  236. package/dist/lib/version.d.ts +2 -0
  237. package/dist/lib/version.d.ts.map +1 -0
  238. package/dist/lib/version.js +49 -0
  239. package/dist/lib/version.js.map +1 -0
  240. package/dist/utils/update-checker.d.ts +34 -0
  241. package/dist/utils/update-checker.d.ts.map +1 -0
  242. package/dist/utils/update-checker.js +142 -0
  243. package/dist/utils/update-checker.js.map +1 -0
  244. package/package.json +125 -0
  245. package/templates/docs.json +11 -0
  246. package/templates/introduction.mdx +19 -0
  247. package/templates/quickstart.mdx +20 -0
  248. package/vendored/app/[[...slug]]/error.tsx +103 -0
  249. package/vendored/app/[[...slug]]/page.tsx +690 -0
  250. package/vendored/app/api/assets/[...path]/route.ts +78 -0
  251. package/vendored/app/api/ev/route.ts +61 -0
  252. package/vendored/app/api/isr-health/route.ts +66 -0
  253. package/vendored/app/api/mcp/[project]/route.ts +435 -0
  254. package/vendored/app/api/og/route.tsx +167 -0
  255. package/vendored/app/api/r2/[project]/[...path]/route.ts +214 -0
  256. package/vendored/app/api/revalidate/route.ts +76 -0
  257. package/vendored/app/globals.css +37 -0
  258. package/vendored/app/layout.tsx +571 -0
  259. package/vendored/app/not-found.tsx +47 -0
  260. package/vendored/components/CodeBlockCopyButton.tsx +146 -0
  261. package/vendored/components/HeaderLinkCopy.tsx +135 -0
  262. package/vendored/components/errors/NotFoundContent.tsx +147 -0
  263. package/vendored/components/layout/LayoutWrapper.tsx +128 -0
  264. package/vendored/components/mdx/Accordion.tsx +91 -0
  265. package/vendored/components/mdx/ApiCodePanel.tsx +51 -0
  266. package/vendored/components/mdx/ApiEndpoint.tsx +104 -0
  267. package/vendored/components/mdx/ApiPage.tsx +379 -0
  268. package/vendored/components/mdx/Badge.tsx +169 -0
  269. package/vendored/components/mdx/Callouts.tsx +140 -0
  270. package/vendored/components/mdx/Card.tsx +214 -0
  271. package/vendored/components/mdx/CodeGroup.tsx +136 -0
  272. package/vendored/components/mdx/Color.tsx +244 -0
  273. package/vendored/components/mdx/Columns.tsx +37 -0
  274. package/vendored/components/mdx/Expandable.tsx +37 -0
  275. package/vendored/components/mdx/Frame.tsx +51 -0
  276. package/vendored/components/mdx/Icon.tsx +132 -0
  277. package/vendored/components/mdx/Latex.tsx +75 -0
  278. package/vendored/components/mdx/MDXComponents.tsx +414 -0
  279. package/vendored/components/mdx/Mermaid.tsx +35 -0
  280. package/vendored/components/mdx/MermaidInner.tsx +342 -0
  281. package/vendored/components/mdx/OpenApiEndpoint.tsx +971 -0
  282. package/vendored/components/mdx/Panel.tsx +26 -0
  283. package/vendored/components/mdx/PanelWrapper.tsx +100 -0
  284. package/vendored/components/mdx/ParamField.tsx +75 -0
  285. package/vendored/components/mdx/RequestExample.tsx +91 -0
  286. package/vendored/components/mdx/ResponseExample.tsx +145 -0
  287. package/vendored/components/mdx/ResponseField.tsx +109 -0
  288. package/vendored/components/mdx/Steps.tsx +173 -0
  289. package/vendored/components/mdx/Table.tsx +352 -0
  290. package/vendored/components/mdx/Tabs.tsx +147 -0
  291. package/vendored/components/mdx/Tile.tsx +127 -0
  292. package/vendored/components/mdx/Tooltip.tsx +111 -0
  293. package/vendored/components/mdx/Tree.tsx +484 -0
  294. package/vendored/components/mdx/Update.tsx +90 -0
  295. package/vendored/components/mdx/View.tsx +354 -0
  296. package/vendored/components/mdx/YouTube.tsx +35 -0
  297. package/vendored/components/mdx/ZoomableImage.tsx +83 -0
  298. package/vendored/components/navigation/Breadcrumb.tsx +241 -0
  299. package/vendored/components/navigation/DefaultLogo.tsx +81 -0
  300. package/vendored/components/navigation/Header.tsx +512 -0
  301. package/vendored/components/navigation/LanguageSelector.tsx +249 -0
  302. package/vendored/components/navigation/PageNavigation.tsx +174 -0
  303. package/vendored/components/navigation/Sidebar.tsx +713 -0
  304. package/vendored/components/navigation/SocialFooter.tsx +186 -0
  305. package/vendored/components/navigation/TableOfContents.tsx +435 -0
  306. package/vendored/components/navigation/TabsNav.tsx +182 -0
  307. package/vendored/components/search/LazySearchModal.tsx +19 -0
  308. package/vendored/components/search/SearchModal.tsx +573 -0
  309. package/vendored/components/snippets/ProjectSnippets.tsx +4 -0
  310. package/vendored/components/theme/ThemeProvider.tsx +31 -0
  311. package/vendored/components/theme/ThemeToggle.tsx +134 -0
  312. package/vendored/components/ui/CodePanel.tsx +517 -0
  313. package/vendored/components/ui/CodePanelModal.tsx +342 -0
  314. package/vendored/contexts/TabSyncContext.tsx +30 -0
  315. package/vendored/hooks/useFocusTrap.ts +42 -0
  316. package/vendored/hooks/useHashNavigation.ts +39 -0
  317. package/vendored/hooks/useShikiHighlight.ts +101 -0
  318. package/vendored/lib/analytics-client.ts +77 -0
  319. package/vendored/lib/build/cache.ts +138 -0
  320. package/vendored/lib/build/error-parser.ts +690 -0
  321. package/vendored/lib/build/estimation.ts +113 -0
  322. package/vendored/lib/build/index.ts +17 -0
  323. package/vendored/lib/build/page-file-map.ts +48 -0
  324. package/vendored/lib/build/r2-upload.ts +179 -0
  325. package/vendored/lib/cache-keys.ts +117 -0
  326. package/vendored/lib/code-utils.ts +42 -0
  327. package/vendored/lib/content-loader.ts +176 -0
  328. package/vendored/lib/deprecated-components.ts +185 -0
  329. package/vendored/lib/docs-isr.ts +180 -0
  330. package/vendored/lib/docs-types.ts +874 -0
  331. package/vendored/lib/docs.ts +203 -0
  332. package/vendored/lib/domain-helpers.ts +107 -0
  333. package/vendored/lib/email-notifier.ts +102 -0
  334. package/vendored/lib/email-templates/build-failure.tsx +193 -0
  335. package/vendored/lib/email-templates/components/base-layout.tsx +150 -0
  336. package/vendored/lib/email-templates/components/error-box.tsx +88 -0
  337. package/vendored/lib/email-templates/components/info-row.tsx +63 -0
  338. package/vendored/lib/email-templates/index.ts +13 -0
  339. package/vendored/lib/empty-polyfill.js +3 -0
  340. package/vendored/lib/extract-highlights.ts +124 -0
  341. package/vendored/lib/fonts.ts +227 -0
  342. package/vendored/lib/frontmatter-utils.ts +77 -0
  343. package/vendored/lib/fs-utils.ts +20 -0
  344. package/vendored/lib/git-utils.ts +87 -0
  345. package/vendored/lib/health-checks.ts +224 -0
  346. package/vendored/lib/icon-utils.ts +492 -0
  347. package/vendored/lib/infer-page-type.ts +14 -0
  348. package/vendored/lib/isr-build-executor.ts +185 -0
  349. package/vendored/lib/language-icons.ts +152 -0
  350. package/vendored/lib/language-utils.ts +338 -0
  351. package/vendored/lib/latex-config.ts +64 -0
  352. package/vendored/lib/link-prefix-context.tsx +32 -0
  353. package/vendored/lib/logger.ts +63 -0
  354. package/vendored/lib/mcp-search.ts +255 -0
  355. package/vendored/lib/mdx-inline-components.ts +155 -0
  356. package/vendored/lib/mdx.ts +100 -0
  357. package/vendored/lib/middleware-helpers.ts +519 -0
  358. package/vendored/lib/navigation-resolver.ts +621 -0
  359. package/vendored/lib/navigation-utils.ts +103 -0
  360. package/vendored/lib/normalize-config.ts +94 -0
  361. package/vendored/lib/openapi/cache.ts +92 -0
  362. package/vendored/lib/openapi/code-examples.ts +389 -0
  363. package/vendored/lib/openapi/errors.ts +253 -0
  364. package/vendored/lib/openapi/generator.ts +230 -0
  365. package/vendored/lib/openapi/index.ts +84 -0
  366. package/vendored/lib/openapi/parser.ts +474 -0
  367. package/vendored/lib/openapi/types.ts +232 -0
  368. package/vendored/lib/openapi/validator.ts +156 -0
  369. package/vendored/lib/openapi-isr.ts +121 -0
  370. package/vendored/lib/page-isr-helpers.ts +137 -0
  371. package/vendored/lib/path-safety.ts +130 -0
  372. package/vendored/lib/paths.ts +35 -0
  373. package/vendored/lib/preprocess-mdx.ts +951 -0
  374. package/vendored/lib/process-mdx-with-exports.ts +75 -0
  375. package/vendored/lib/project-resolver.ts +165 -0
  376. package/vendored/lib/r2-content.ts +60 -0
  377. package/vendored/lib/r2-manifest.ts +84 -0
  378. package/vendored/lib/recent-searches.ts +41 -0
  379. package/vendored/lib/recma-compound-components.ts +84 -0
  380. package/vendored/lib/redirect-compiler.ts +160 -0
  381. package/vendored/lib/redirect-matcher.ts +296 -0
  382. package/vendored/lib/redis.ts +23 -0
  383. package/vendored/lib/rehype-class-to-classname.ts +31 -0
  384. package/vendored/lib/rehype-code-meta.ts +275 -0
  385. package/vendored/lib/rehype-nozoom-to-data.ts +45 -0
  386. package/vendored/lib/remark-extract-exports.ts +104 -0
  387. package/vendored/lib/resilience.ts +260 -0
  388. package/vendored/lib/revalidation-helpers.ts +200 -0
  389. package/vendored/lib/revalidation-trigger.ts +150 -0
  390. package/vendored/lib/screenshot-capture.ts +229 -0
  391. package/vendored/lib/search-client.ts +91 -0
  392. package/vendored/lib/search-suggestions.ts +38 -0
  393. package/vendored/lib/search.ts +158 -0
  394. package/vendored/lib/seo.ts +264 -0
  395. package/vendored/lib/shiki-client.ts +131 -0
  396. package/vendored/lib/shiki-config.ts +289 -0
  397. package/vendored/lib/shiki-css-theme.ts +46 -0
  398. package/vendored/lib/shiki-highlighter.ts +62 -0
  399. package/vendored/lib/shiki-transformers.ts +337 -0
  400. package/vendored/lib/slack-notifier.ts +248 -0
  401. package/vendored/lib/snippet-compiler-isr.ts +114 -0
  402. package/vendored/lib/snippet-loader-isr.ts +276 -0
  403. package/vendored/lib/static-artifacts.ts +375 -0
  404. package/vendored/lib/static-file-route.ts +72 -0
  405. package/vendored/lib/tracking-script.ts +19 -0
  406. package/vendored/lib/typography-config.ts +42 -0
  407. package/vendored/lib/validate-config.ts +268 -0
  408. package/vendored/next.config.js +45 -0
  409. package/vendored/postcss.config.js +6 -0
  410. package/vendored/schema/README.md +28 -0
  411. package/vendored/schema/docs-schema.json +4631 -0
  412. package/vendored/scripts/build-project.cjs +174 -0
  413. package/vendored/scripts/build-search-index.cjs +347 -0
  414. package/vendored/scripts/compile-snippets.cjs +488 -0
  415. package/vendored/scripts/copy-files.cjs +295 -0
  416. package/vendored/scripts/dev-project.cjs +534 -0
  417. package/vendored/scripts/enhance-navigation.cjs +354 -0
  418. package/vendored/scripts/validate-links.cjs +423 -0
  419. package/vendored/shared/constants.ts +6 -0
  420. package/vendored/shared/index.ts +19 -0
  421. package/vendored/shared/logger.ts +62 -0
  422. package/vendored/shared/memory-monitor.ts +190 -0
  423. package/vendored/shared/navigation-validator.ts +101 -0
  424. package/vendored/shared/path-security.ts +39 -0
  425. package/vendored/shared/status-reporter.ts +199 -0
  426. package/vendored/shared/timer.ts +51 -0
  427. package/vendored/shared/types.ts +102 -0
  428. package/vendored/tailwind.config.ts +39 -0
  429. package/vendored/themes/base.css +1311 -0
  430. package/vendored/themes/index.ts +119 -0
  431. package/vendored/themes/jam/variables.css +835 -0
  432. package/vendored/themes/nebula/variables.css +282 -0
  433. package/vendored/themes/pulsar/variables.css +1009 -0
  434. package/vendored/themes/types.ts +89 -0
  435. package/vendored/tsconfig.json +48 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Jamdesk
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,323 @@
1
+ # Jamdesk CLI
2
+
3
+ [![npm version](https://img.shields.io/npm/v/jamdesk)](https://www.npmjs.com/package/jamdesk)
4
+ [![Node.js](https://img.shields.io/node/v/jamdesk)](https://nodejs.org)
5
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
6
+
7
+ CLI for [Jamdesk](https://jamdesk.com) — build, preview, and deploy documentation sites from MDX.
8
+
9
+ ![Jamdesk documentation site showing dark mode with sidebar navigation and API reference](https://jamdesk.com/cli-screenshot.jpg)
10
+
11
+ ## What is Jamdesk?
12
+
13
+ Jamdesk is a docs-as-code platform. Connect a GitHub repo, write in MDX, and your docs deploy globally in seconds — with AI search, analytics, and custom domains built in. The CLI is how you develop locally: preview your site, validate config, catch broken links, and migrate from other tools.
14
+
15
+ - **Dev server** — Turbopack-powered with hot reload on every save
16
+ - **50+ MDX components** — accordions, tabs, code groups, callouts, [and more](https://jamdesk.com/docs/components/overview)
17
+ - **Three themes** — Jam, Nebula, Pulsar. Configured in `docs.json`
18
+ - **OpenAPI** — auto-generate API reference pages from your specs
19
+ - **Full-text search** — works locally and in production, with AI search on hosted sites
20
+ - **Validation** — broken links, MDX syntax errors, config issues. Catch them before deploy
21
+ - **Mintlify migration** — one command to convert your existing docs
22
+
23
+ ## Quick Start
24
+
25
+ ```bash
26
+ jamdesk init my-docs
27
+ cd my-docs
28
+ jamdesk dev
29
+ ```
30
+
31
+ Your docs are at **http://localhost:3000/docs**. That's it.
32
+
33
+ ## Installation
34
+
35
+ ### npm (recommended)
36
+
37
+ ```bash
38
+ npm install -g jamdesk
39
+ ```
40
+
41
+ ### Homebrew (macOS/Linux)
42
+
43
+ ```bash
44
+ brew tap jamdesk/tap
45
+ brew install jamdesk
46
+ ```
47
+
48
+ ### curl (macOS/Linux)
49
+
50
+ ```bash
51
+ curl -fsSL https://get.jamdesk.com | bash
52
+
53
+ # Install specific version
54
+ curl -fsSL https://get.jamdesk.com | bash -s -- --version 1.2.3
55
+
56
+ # Upgrade
57
+ curl -fsSL https://get.jamdesk.com/upgrade | bash
58
+
59
+ # Uninstall
60
+ curl -fsSL https://get.jamdesk.com/uninstall | bash
61
+ ```
62
+
63
+ ### PowerShell (Windows)
64
+
65
+ ```powershell
66
+ # Install
67
+ iwr https://get.jamdesk.com/win | iex
68
+
69
+ # Upgrade
70
+ iwr https://get.jamdesk.com/upgrade | iex
71
+
72
+ # Uninstall
73
+ iwr https://get.jamdesk.com/uninstall | iex
74
+ ```
75
+
76
+ ### npx (no install)
77
+
78
+ ```bash
79
+ npx jamdesk dev
80
+ ```
81
+
82
+ ## Commands
83
+
84
+ | Command | Description |
85
+ |---------|-------------|
86
+ | `jamdesk init [name]` | Create a new docs project |
87
+ | `jamdesk dev` | Start dev server with Turbopack |
88
+ | `jamdesk preview` | Alias for `jamdesk dev` |
89
+ | `jamdesk dev --webpack` | Use Webpack instead of Turbopack |
90
+ | `jamdesk dev --clean` | Clear cache before starting |
91
+ | `jamdesk dev --port 3001` | Custom port |
92
+ | `jamdesk migrate` | Migrate from Mintlify |
93
+ | `jamdesk validate` | Validate docs.json, MDX syntax, OpenAPI specs |
94
+ | `jamdesk openapi-check <spec>` | Validate a single OpenAPI spec |
95
+ | `jamdesk broken-links` | Find broken internal links |
96
+ | `jamdesk rename <from> <to>` | Rename file, update all references |
97
+ | `jamdesk deploy <target>` | Deploy wizard (Cloudflare Worker setup, auth, config) |
98
+ | `jamdesk doctor` | Diagnose environment issues |
99
+ | `jamdesk clean` | Clear ~/.jamdesk cache |
100
+ | `jamdesk update` | Update to latest version |
101
+ | `jamdesk update --check` | Check for updates without installing |
102
+
103
+ All commands support `--verbose`. Run `jamdesk <command> --help` for details.
104
+
105
+ ## Dev Server
106
+
107
+ Run `jamdesk dev` at the root of your project (where `docs.json` lives) to preview docs locally. Turbopack is the default and compiles roughly 5x faster than Webpack.
108
+
109
+ ```bash
110
+ jamdesk dev # Turbopack (default)
111
+ jamdesk dev --webpack # Webpack (slower, more compatible)
112
+ jamdesk dev --clean # Clear cache first
113
+ jamdesk dev --port 3001 # Custom port
114
+ ```
115
+
116
+ The dev server auto-validates on startup, auto-recovers from corrupted Turbopack cache, and auto-increments the port if yours is taken. Full search, all themes, and all components work locally.
117
+
118
+ Set a default port in `~/.jamdeskrc`:
119
+
120
+ ```json
121
+ {
122
+ "defaultPort": 3001
123
+ }
124
+ ```
125
+
126
+ ## Validation
127
+
128
+ ### `jamdesk validate`
129
+
130
+ Checks your project for issues:
131
+
132
+ - **docs.json** — schema validation against the [Jamdesk spec](https://jamdesk.com/docs/config/docs-json-reference)
133
+ - **MDX syntax** — catches things like `<50%` being parsed as JSX
134
+ - **OpenAPI specs** — validates if configured
135
+ - **Navigation** — warns when pages in your nav don't exist
136
+
137
+ ```bash
138
+ jamdesk validate
139
+ jamdesk validate --skip-mdx # Skip MDX checks
140
+ ```
141
+
142
+ Example output:
143
+
144
+ ```
145
+ ✗ Found 1 MDX syntax error(s)
146
+
147
+ getting-started.mdx:42
148
+ Unexpected character `5` (U+0035) before name
149
+ Fix: A < character is being parsed as JSX. Use &lt; or rewrite (e.g., "Below 50%" instead of "<50%")
150
+ ```
151
+
152
+ ### `jamdesk openapi-check`
153
+
154
+ Validate a single OpenAPI spec:
155
+
156
+ ```bash
157
+ jamdesk openapi-check path/to/openapi.yaml
158
+ ```
159
+
160
+ Reports endpoint count, schemas, tags. Warns if you're on Swagger 2.0.
161
+
162
+ ### `jamdesk broken-links`
163
+
164
+ Find broken internal links across your docs:
165
+
166
+ ```bash
167
+ jamdesk broken-links
168
+ ```
169
+
170
+ ```
171
+ docs/getting-started.mdx:15 - /docs/quikstart
172
+ Did you mean: /docs/quickstart
173
+
174
+ Found 1 broken link in 45 files.
175
+ ```
176
+
177
+ ## File Management
178
+
179
+ Rename a page and every reference updates automatically — docs.json navigation, internal links, snippet imports:
180
+
181
+ ```bash
182
+ jamdesk rename docs/old-name.mdx docs/new-name.mdx
183
+ ```
184
+
185
+ ## Migration
186
+
187
+ ### `jamdesk migrate`
188
+
189
+ Migrate from Mintlify to Jamdesk:
190
+
191
+ ```bash
192
+ cd /path/to/mintlify-docs
193
+ jamdesk migrate
194
+ ```
195
+
196
+ Detects your `mint.json`, converts config to `docs.json`, lets you pick a theme, copies everything.
197
+
198
+ **What gets converted:**
199
+
200
+ - **Config** — `mint.json` → `docs.json` (navbar, navigation, footer, SEO, appearance)
201
+ - **Components** — deprecated components like `<CardGroup>` → `<Columns>`
202
+ - **React hooks** — inline components with `useState`/`useEffect` get extracted to `/snippets` as `.tsx` files with `'use client'`
203
+ - **Video embeds** — iframe normalization
204
+
205
+ | Option | Description |
206
+ |--------|-------------|
207
+ | `--yes`, `-y` | Skip confirmation prompts |
208
+ | `--theme <theme>` | Pre-select theme (`jam`, `nebula`, `pulsar`) |
209
+
210
+ After migration:
211
+
212
+ ```bash
213
+ cd jamdesk-docs
214
+ jamdesk dev
215
+ ```
216
+
217
+ See the [migration guide](https://jamdesk.com/docs/migration) for the full list of conversions.
218
+
219
+ ## Deployment
220
+
221
+ ### Jamdesk Hosting
222
+
223
+ Push your docs to GitHub and Jamdesk builds and deploys them automatically. Your site gets a `*.jamdesk.app` subdomain with SSL, AI search, analytics, and custom domain support — no infrastructure to manage.
224
+
225
+ [Get started with Jamdesk hosting](https://jamdesk.com/docs/quickstart)
226
+
227
+ ### Cloudflare Worker (subpath hosting)
228
+
229
+ Host your docs at a subpath on your existing domain (e.g., `yoursite.com/docs`) using a Cloudflare Worker:
230
+
231
+ ```bash
232
+ jamdesk deploy cloudflare
233
+ ```
234
+
235
+ The wizard handles wrangler setup, Cloudflare auth, zone selection, and worker generation. Supports multiple accounts.
236
+
237
+ | Option | Description |
238
+ |--------|-------------|
239
+ | `--slug <slug>` | Project slug (skip auto-detection) |
240
+ | `--domain <domain>` | Target domain (e.g., yoursite.com) |
241
+ | `--path <path>` | Path prefix (default: /docs) |
242
+ | `--output-dir <dir>` | Output directory (default: cloudflare-worker/) |
243
+ | `--skip-deploy` | Generate files only |
244
+ | `--force` | Overwrite existing directory |
245
+ | `--yes` | Skip prompts (CI mode) |
246
+
247
+ ```bash
248
+ jamdesk deploy cloudflare --slug acme --domain example.com --path /docs --yes
249
+ ```
250
+
251
+ Generates `index.js`, `wrangler.toml`, `package.json`, and `.gitignore`. Deploy manually with `npx wrangler deploy`.
252
+
253
+ See the [Cloudflare deployment guide](https://jamdesk.com/docs/deploy/cloudflare) for details.
254
+
255
+ ## Configuration
256
+
257
+ Everything lives in `docs.json` — themes, navigation, branding, integrations (analytics, OpenAPI, search), and SEO. Works with monorepos too.
258
+
259
+ See the [docs.json reference](https://jamdesk.com/docs/config/docs-json-reference) for all options.
260
+
261
+ ### CLI Defaults
262
+
263
+ `~/.jamdeskrc`:
264
+
265
+ ```json
266
+ {
267
+ "defaultPort": 3001,
268
+ "verbose": false,
269
+ "checkUpdates": true
270
+ }
271
+ ```
272
+
273
+ ## Troubleshooting
274
+
275
+ **"docs.json not found"**
276
+ - Run from a directory with `docs.json`, or `jamdesk init` to start fresh
277
+
278
+ **Dev server won't start**
279
+ - `jamdesk doctor` to check your environment
280
+ - `jamdesk clean` to clear the cache
281
+ - `jamdesk dev --verbose` for details
282
+
283
+ **Turbopack cache corruption**
284
+ - `jamdesk dev --clean` to clear and restart
285
+ - Happens when the dev server is killed mid-build
286
+
287
+ **Slow first run**
288
+ - First run installs deps to `~/.jamdesk/node_modules`. Subsequent runs are fast.
289
+
290
+ **Port in use**
291
+ - `jamdesk dev --port 3001` or let auto-increment find the next open port
292
+
293
+ **MDX syntax errors**
294
+ - `<` is parsed as JSX in MDX. Use `&lt;` or rewrite ("Below 50%" instead of "<50%")
295
+ - `jamdesk validate` shows errors with line numbers
296
+
297
+ ## Requirements
298
+
299
+ - Node.js v20.0.0+
300
+ - npm v8+ (recommended)
301
+
302
+ ## Learn More
303
+
304
+ - [Documentation](https://jamdesk.com/docs)
305
+ - [Getting Started](https://jamdesk.com/docs/quickstart)
306
+ - [Components](https://jamdesk.com/docs/components/overview)
307
+ - [Themes](https://jamdesk.com/docs/themes)
308
+ - [Config Reference](https://jamdesk.com/docs/config/docs-json-reference)
309
+ - [OpenAPI](https://jamdesk.com/docs/api-reference/openapi-setup)
310
+ - [Deployment](https://jamdesk.com/docs/deploy)
311
+ - [Homepage](https://jamdesk.com)
312
+ - [Pricing](https://jamdesk.com/pricing)
313
+
314
+ **Example:** [jamdesk.com/docs](https://jamdesk.com/docs)
315
+
316
+ ## Support
317
+
318
+ - [Report Issues](https://github.com/jamdesk/jamdesk/issues)
319
+ - [Contact Support](https://jamdesk.com/docs/help/support/contact)
320
+
321
+ ## License
322
+
323
+ MIT
package/bin/jamdesk.js ADDED
@@ -0,0 +1,76 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { existsSync, statSync, readdirSync } from 'fs';
4
+ import { join, dirname } from 'path';
5
+ import { fileURLToPath } from 'url';
6
+ import { execSync } from 'child_process';
7
+
8
+ const __dirname = dirname(fileURLToPath(import.meta.url));
9
+ const cliRoot = join(__dirname, '..');
10
+
11
+ /**
12
+ * Check if any TypeScript source files are newer than the compiled dist.
13
+ * This catches cases where someone edited src/ but forgot to rebuild.
14
+ */
15
+ function isDistStale() {
16
+ const srcDir = join(cliRoot, 'src');
17
+ const distIndex = join(cliRoot, 'dist', 'index.js');
18
+
19
+ // Only check in development (when src/ exists)
20
+ if (!existsSync(srcDir)) return false;
21
+
22
+ // Get dist/index.js mtime, or return stale if it doesn't exist
23
+ let distMtime;
24
+ try {
25
+ distMtime = statSync(distIndex).mtimeMs;
26
+ } catch {
27
+ return true;
28
+ }
29
+
30
+ return hasNewerSourceFiles(srcDir, distMtime);
31
+ }
32
+
33
+ /**
34
+ * Recursively check if any .ts/.tsx files are newer than the given timestamp.
35
+ */
36
+ function hasNewerSourceFiles(dir, threshold) {
37
+ let entries;
38
+ try {
39
+ entries = readdirSync(dir, { withFileTypes: true });
40
+ } catch {
41
+ return false;
42
+ }
43
+
44
+ for (const entry of entries) {
45
+ if (entry.name.startsWith('.') || entry.name === '__tests__') continue;
46
+
47
+ const fullPath = join(dir, entry.name);
48
+
49
+ if (entry.isDirectory()) {
50
+ if (hasNewerSourceFiles(fullPath, threshold)) return true;
51
+ } else if (entry.name.endsWith('.ts') || entry.name.endsWith('.tsx')) {
52
+ try {
53
+ if (statSync(fullPath).mtimeMs > threshold) return true;
54
+ } catch {
55
+ // Skip unreadable files
56
+ }
57
+ }
58
+ }
59
+
60
+ return false;
61
+ }
62
+
63
+ // Check for stale dist and auto-rebuild if needed
64
+ if (isDistStale()) {
65
+ console.log('\x1b[33m⚠ Source files are newer than compiled dist, rebuilding...\x1b[0m');
66
+ try {
67
+ // Safe: hardcoded command with no user input
68
+ execSync('npm run build', { cwd: cliRoot, stdio: 'inherit' });
69
+ console.log('\x1b[32m✓ Rebuild complete\x1b[0m\n');
70
+ } catch (err) {
71
+ console.error('\x1b[31m✗ Rebuild failed. Run "npm run build" manually.\x1b[0m');
72
+ process.exit(1);
73
+ }
74
+ }
75
+
76
+ import('../dist/index.js');
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Integration tests for deprecated component detection in CLI
3
+ *
4
+ * Tests that the dev command properly detects deprecated components
5
+ * and provides actionable error messages.
6
+ */
7
+ export {};
8
+ //# sourceMappingURL=deprecated-components.integration.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deprecated-components.integration.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/integration/deprecated-components.integration.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
@@ -0,0 +1,165 @@
1
+ /**
2
+ * Integration tests for deprecated component detection in CLI
3
+ *
4
+ * Tests that the dev command properly detects deprecated components
5
+ * and provides actionable error messages.
6
+ */
7
+ import { describe, it, expect, beforeAll, afterAll } from 'vitest';
8
+ import fs from 'fs-extra';
9
+ import path from 'path';
10
+ import os from 'os';
11
+ import { checkForDeprecatedComponents, DEPRECATED_COMPONENTS } from '../../lib/deprecated-components.js';
12
+ describe('deprecated component detection integration', () => {
13
+ let tempDir;
14
+ beforeAll(async () => {
15
+ // Create a temporary directory for test fixtures
16
+ tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'jamdesk-test-'));
17
+ });
18
+ afterAll(async () => {
19
+ // Clean up temp directory
20
+ await fs.remove(tempDir);
21
+ });
22
+ describe('checkForDeprecatedComponents', () => {
23
+ it('detects CardGroup in MDX content', () => {
24
+ const content = `---
25
+ title: Getting Started
26
+ ---
27
+
28
+ # Welcome
29
+
30
+ <CardGroup cols={2}>
31
+ <Card title="Quick Start" href="/quickstart" />
32
+ <Card title="Installation" href="/install" />
33
+ </CardGroup>
34
+ `;
35
+ const errors = checkForDeprecatedComponents(content, 'getting-started.mdx');
36
+ expect(errors).toHaveLength(1);
37
+ expect(errors[0].component).toBe('CardGroup');
38
+ expect(errors[0].file).toBe('getting-started.mdx');
39
+ expect(errors[0].line).toBe(7); // Line where <CardGroup> appears
40
+ expect(errors[0].replacement).toBe('Columns');
41
+ expect(errors[0].migrationHint).toContain('<Columns');
42
+ });
43
+ it('detects CardGroup with different casing', () => {
44
+ const content = `<cardgroup cols={3}></cardgroup>`;
45
+ const errors = checkForDeprecatedComponents(content, 'test.mdx');
46
+ expect(errors).toHaveLength(1);
47
+ expect(errors[0].component).toBe('CardGroup');
48
+ });
49
+ it('returns empty array when no deprecated components found', () => {
50
+ const content = `---
51
+ title: Clean Page
52
+ ---
53
+
54
+ # Clean Content
55
+
56
+ <Columns cols={2}>
57
+ <Card title="Item 1" />
58
+ <Card title="Item 2" />
59
+ </Columns>
60
+ `;
61
+ const errors = checkForDeprecatedComponents(content, 'clean.mdx');
62
+ expect(errors).toHaveLength(0);
63
+ });
64
+ it('detects multiple deprecated components in same file', () => {
65
+ const content = `
66
+ # Page with multiple deprecated components
67
+
68
+ <CardGroup cols={2}>
69
+ <Card title="First" />
70
+ </CardGroup>
71
+
72
+ Some text in between.
73
+
74
+ <CardGroup cols={3}>
75
+ <Card title="Second" />
76
+ </CardGroup>
77
+ `;
78
+ const errors = checkForDeprecatedComponents(content, 'multi.mdx');
79
+ // Implementation finds first occurrence per component type
80
+ expect(errors).toHaveLength(1);
81
+ expect(errors[0].component).toBe('CardGroup');
82
+ });
83
+ it('provides correct line numbers', () => {
84
+ const content = `Line 1
85
+ Line 2
86
+ Line 3
87
+ <CardGroup>
88
+ Line 5
89
+ </CardGroup>`;
90
+ const errors = checkForDeprecatedComponents(content, 'lines.mdx');
91
+ expect(errors).toHaveLength(1);
92
+ expect(errors[0].line).toBe(4); // CardGroup is on line 4
93
+ });
94
+ it('does not false-positive on CardGroup in code blocks', () => {
95
+ // Note: Current implementation doesn't skip code blocks
96
+ // This test documents current behavior
97
+ const content = `
98
+ \`\`\`jsx
99
+ <CardGroup cols={2}>
100
+ <Card />
101
+ </CardGroup>
102
+ \`\`\`
103
+ `;
104
+ const errors = checkForDeprecatedComponents(content, 'codeblock.mdx');
105
+ // Current behavior: it will detect it even in code blocks
106
+ // This is acceptable as it's rare to have deprecated components in code examples
107
+ // and the user can safely ignore the warning
108
+ expect(errors).toHaveLength(1);
109
+ });
110
+ });
111
+ describe('DEPRECATED_COMPONENTS map', () => {
112
+ it('includes CardGroup with proper metadata', () => {
113
+ expect(DEPRECATED_COMPONENTS).toHaveProperty('CardGroup');
114
+ expect(DEPRECATED_COMPONENTS.CardGroup.replacement).toBe('Columns');
115
+ expect(DEPRECATED_COMPONENTS.CardGroup.migrationHint).toContain('CardGroup');
116
+ expect(DEPRECATED_COMPONENTS.CardGroup.migrationHint).toContain('Columns');
117
+ });
118
+ it('has required fields for all deprecated components', () => {
119
+ for (const [name, info] of Object.entries(DEPRECATED_COMPONENTS)) {
120
+ expect(info.name).toBe(name);
121
+ expect(typeof info.replacement).toBe('string');
122
+ expect(info.replacement.length).toBeGreaterThan(0);
123
+ expect(typeof info.migrationHint).toBe('string');
124
+ expect(info.migrationHint.length).toBeGreaterThan(0);
125
+ }
126
+ });
127
+ });
128
+ describe('file scanning workflow', () => {
129
+ it('scans MDX file from disk and detects deprecated components', async () => {
130
+ // Create a test MDX file
131
+ const testFile = path.join(tempDir, 'test-page.mdx');
132
+ await fs.writeFile(testFile, `---
133
+ title: Test Page
134
+ ---
135
+
136
+ <CardGroup cols={2}>
137
+ <Card title="Test" />
138
+ </CardGroup>
139
+ `);
140
+ // Read and check
141
+ const content = await fs.readFile(testFile, 'utf-8');
142
+ const errors = checkForDeprecatedComponents(content, 'test-page.mdx');
143
+ expect(errors).toHaveLength(1);
144
+ expect(errors[0].component).toBe('CardGroup');
145
+ });
146
+ it('scans snippet file from disk and detects deprecated components', async () => {
147
+ // Create a test snippet file
148
+ const snippetsDir = path.join(tempDir, 'snippets');
149
+ await fs.ensureDir(snippetsDir);
150
+ const snippetFile = path.join(snippetsDir, 'card-layout.mdx');
151
+ await fs.writeFile(snippetFile, `<CardGroup cols={3}>
152
+ <Card title="A" />
153
+ <Card title="B" />
154
+ <Card title="C" />
155
+ </CardGroup>
156
+ `);
157
+ // Read and check
158
+ const content = await fs.readFile(snippetFile, 'utf-8');
159
+ const errors = checkForDeprecatedComponents(content, 'snippets/card-layout.mdx');
160
+ expect(errors).toHaveLength(1);
161
+ expect(errors[0].file).toBe('snippets/card-layout.mdx');
162
+ });
163
+ });
164
+ });
165
+ //# sourceMappingURL=deprecated-components.integration.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deprecated-components.integration.test.js","sourceRoot":"","sources":["../../../src/__tests__/integration/deprecated-components.integration.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACnE,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAEzG,QAAQ,CAAC,4CAA4C,EAAE,GAAG,EAAE;IAC1D,IAAI,OAAe,CAAC;IAEpB,SAAS,CAAC,KAAK,IAAI,EAAE;QACnB,iDAAiD;QACjD,OAAO,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,eAAe,CAAC,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,KAAK,IAAI,EAAE;QAClB,0BAA0B;QAC1B,MAAM,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;QAC5C,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;YAC1C,MAAM,OAAO,GAAG;;;;;;;;;;CAUrB,CAAC;YAEI,MAAM,MAAM,GAAG,4BAA4B,CAAC,OAAO,EAAE,qBAAqB,CAA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AC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACrD,MAAM,MAAM,GAAG,4BAA4B,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;YAEtE,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YAC/B,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,gEAAgE,EAAE,KAAK,IAAI,EAAE;YAC9E,6BAA6B;YAC7B,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;YACnD,MAAM,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;YAChC,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;YAC9D,MAAM,EAAE,CAAC,SAAS,CAAC,WAAW,EAAE;;;;;CAKrC,CAAC,CAAC;YAEG,iBAAiB;YACjB,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;YACxD,MAAM,MAAM,GAAG,4BAA4B,CAAC,OAAO,EAAE,0BAA0B,CAAC,CAAC;YAEjF,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YAC/B,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=migrate.integration.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate.integration.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/integration/migrate.integration.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,64 @@
1
+ import { describe, it, expect, beforeEach, afterEach } from 'vitest';
2
+ import fs from 'fs-extra';
3
+ import path from 'path';
4
+ import os from 'os';
5
+ import { findConfigFile, detectMintlify } from '../../commands/migrate/detect.js';
6
+ import { convertMintlifyToJamdesk } from '../../commands/migrate/convert.js';
7
+ describe('migrate integration', () => {
8
+ let tempDir;
9
+ beforeEach(async () => {
10
+ tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'jamdesk-migrate-test-'));
11
+ });
12
+ afterEach(async () => {
13
+ await fs.remove(tempDir);
14
+ });
15
+ it('detects and converts a Mintlify project', async () => {
16
+ // Create a mock Mintlify project
17
+ const mintConfig = {
18
+ $schema: 'https://mintlify.com/schema.json',
19
+ name: 'Test Docs',
20
+ topbarLinks: [{ name: 'Support', url: 'https://support.example.com' }],
21
+ navigation: [
22
+ { group: 'Getting Started', pages: ['intro'] },
23
+ ],
24
+ footerSocials: {
25
+ twitter: 'https://twitter.com/test',
26
+ },
27
+ };
28
+ await fs.writeJSON(path.join(tempDir, 'mint.json'), mintConfig);
29
+ await fs.writeFile(path.join(tempDir, 'intro.mdx'), '# Introduction');
30
+ // Detect the config
31
+ const result = findConfigFile(tempDir);
32
+ expect(result).not.toBeNull();
33
+ expect(result.filename).toBe('mint.json');
34
+ expect(detectMintlify(result.config)).toBe(true);
35
+ // Convert it
36
+ const converted = convertMintlifyToJamdesk(result.config, 'jam');
37
+ expect(converted.$schema).toBe('https://www.jamdesk.com/docs.json');
38
+ expect(converted.theme).toBe('jam');
39
+ expect(converted.navbar?.links).toEqual([
40
+ { label: 'Support', href: 'https://support.example.com' },
41
+ ]);
42
+ expect(converted.navigation?.pages).toEqual([
43
+ { group: 'Getting Started', pages: ['intro'] },
44
+ ]);
45
+ expect(converted.footer?.socials).toEqual({
46
+ twitter: 'https://twitter.com/test',
47
+ });
48
+ });
49
+ it('handles docs.json that is already Jamdesk format', async () => {
50
+ // Create a non-Mintlify project
51
+ const jamdeskConfig = {
52
+ $schema: 'https://www.jamdesk.com/docs.json',
53
+ name: 'Test Docs',
54
+ theme: 'jam',
55
+ };
56
+ await fs.writeJSON(path.join(tempDir, 'docs.json'), jamdeskConfig);
57
+ // Detect the config
58
+ const result = findConfigFile(tempDir);
59
+ expect(result).not.toBeNull();
60
+ expect(result.filename).toBe('docs.json');
61
+ expect(detectMintlify(result.config)).toBe(false);
62
+ });
63
+ });
64
+ //# sourceMappingURL=migrate.integration.test.js.map