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
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Clean Command
3
+ *
4
+ * Clears the ~/.jamdesk cache directory.
5
+ */
6
+ import fs from 'fs-extra';
7
+ import path from 'path';
8
+ import { homedir } from 'os';
9
+ import { output } from '../lib/output.js';
10
+ import { spinner } from '../lib/spinner.js';
11
+ export async function clean() {
12
+ const jamdeskDir = path.join(homedir(), '.jamdesk');
13
+ if (!fs.existsSync(jamdeskDir)) {
14
+ output.info('Nothing to clean - ~/.jamdesk does not exist');
15
+ return;
16
+ }
17
+ const spin = spinner('Calculating cache size...');
18
+ // Calculate total size before cleaning
19
+ const size = await getDirectorySize(jamdeskDir);
20
+ spin.text = `Removing ~/.jamdesk (${formatBytes(size)})...`;
21
+ // Remove the entire directory
22
+ await fs.remove(jamdeskDir);
23
+ spin.succeed(`Cleared ${formatBytes(size)} of cache`);
24
+ console.log('\nCleared:');
25
+ console.log(' - ~/.jamdesk/workspace/ (Build cache)');
26
+ console.log(' - ~/.jamdesk/node_modules/ (installed dependencies)');
27
+ console.log(' - ~/.jamdesk/version-cache.json (update check cache)');
28
+ console.log('\nNext `jamdesk dev` will reinstall dependencies.');
29
+ }
30
+ async function getDirectorySize(dir) {
31
+ let size = 0;
32
+ try {
33
+ const files = await fs.readdir(dir, { withFileTypes: true });
34
+ for (const file of files) {
35
+ const filePath = path.join(dir, file.name);
36
+ if (file.isDirectory()) {
37
+ size += await getDirectorySize(filePath);
38
+ }
39
+ else {
40
+ const stats = await fs.stat(filePath);
41
+ size += stats.size;
42
+ }
43
+ }
44
+ }
45
+ catch {
46
+ // Ignore errors (permission issues, etc.)
47
+ }
48
+ return size;
49
+ }
50
+ function formatBytes(bytes) {
51
+ if (bytes < 1024)
52
+ return `${bytes} B`;
53
+ if (bytes < 1024 * 1024)
54
+ return `${(bytes / 1024).toFixed(1)} KB`;
55
+ if (bytes < 1024 * 1024 * 1024)
56
+ return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
57
+ return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;
58
+ }
59
+ //# sourceMappingURL=clean.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clean.js","sourceRoot":"","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* Generates Cloudflare Worker files for proxying docs at a subpath.
5
+ *
6
+ * Security: Uses execSync only with static commands. User input is never
7
+ * interpolated into command strings - it's passed via cwd option instead.
8
+ */
9
+ import type { DeployCloudflareOptions } from './types.js';
10
+ export declare function deployCloudflare(options: DeployCloudflareOptions): Promise<void>;
11
+ export declare function checkWranglerInstalled(): string;
12
+ //# sourceMappingURL=cloudflare.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloudflare.d.ts","sourceRoot":"","sources":["../../../src/commands/deploy/cloudflare.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAiBH,OAAO,KAAK,EAAE,uBAAuB,EAAoB,MAAM,YAAY,CAAC;AAE5E,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAiEf;AAID,wBAAgB,sBAAsB,IAAI,MAAM,CA8B/C"}
@@ -0,0 +1,409 @@
1
+ /**
2
+ * Deploy Cloudflare Command
3
+ *
4
+ * Generates Cloudflare Worker files for proxying docs at a subpath.
5
+ *
6
+ * Security: Uses execSync only with static commands. User input is never
7
+ * interpolated into command strings - it's passed via cwd option instead.
8
+ */
9
+ import fs from 'fs-extra';
10
+ import path from 'path';
11
+ import { execSync } from 'child_process';
12
+ import { input, confirm, select } from '@inquirer/prompts';
13
+ import { output } from '../../lib/output.js';
14
+ import { spinner } from '../../lib/spinner.js';
15
+ import { CLIError } from '../../lib/errors.js';
16
+ import { loadDocsConfig } from '../../lib/docs-config.js';
17
+ import { generateWorkerCode, generateWranglerConfig, generatePackageJson, generateGitignore, extractRootDomain, } from './templates.js';
18
+ export async function deployCloudflare(options) {
19
+ output.header('Jamdesk Cloudflare Worker Setup');
20
+ console.log('');
21
+ // Step 1: Check wrangler is installed
22
+ output.info('Step 1: Checking for wrangler...');
23
+ const wranglerVersion = checkWranglerInstalled();
24
+ output.success(`Wrangler installed (${wranglerVersion})`);
25
+ // Step 2: Verify Cloudflare account
26
+ console.log('');
27
+ output.info('Step 2: Verifying Cloudflare account...');
28
+ await verifyCloudflareAccount(options.yes);
29
+ // Step 3: Detect or prompt for slug
30
+ console.log('');
31
+ output.info('Step 3: Project configuration...');
32
+ const slug = options.slug || (await detectOrPromptSlug(options.yes));
33
+ output.success(`Using slug: ${slug}`);
34
+ // Step 4: Gather configuration via prompts
35
+ console.log('');
36
+ output.info('Step 4: Deployment configuration...');
37
+ const config = await gatherConfiguration(options, slug);
38
+ // Step 5: Check output directory and generate files
39
+ console.log('');
40
+ output.info('Step 5: Generating files...');
41
+ const outputDir = options.outputDir || 'cloudflare-worker';
42
+ // Check if directory exists and confirm overwrite (skip if --force or --yes)
43
+ if (fs.existsSync(outputDir) && !options.force && !options.yes) {
44
+ const overwrite = await confirm({
45
+ message: `Directory "${outputDir}" already exists. Overwrite?`,
46
+ default: false,
47
+ });
48
+ if (!overwrite) {
49
+ output.warn('Aborted. Use --output-dir, --force, or --yes to proceed.');
50
+ return;
51
+ }
52
+ }
53
+ await generateFiles(config, outputDir);
54
+ // Step 6: Show next steps and optionally deploy
55
+ console.log('');
56
+ output.header('Next steps');
57
+ output.hint(` cd ${outputDir}`);
58
+ output.hint(' npx wrangler login # If not logged in');
59
+ output.hint(' npx wrangler deploy');
60
+ console.log('');
61
+ if (!options.skipDeploy && !options.yes) {
62
+ const shouldDeploy = await confirm({
63
+ message: 'Would you like to deploy now?',
64
+ default: true,
65
+ });
66
+ if (shouldDeploy) {
67
+ await deployWorker(outputDir);
68
+ }
69
+ }
70
+ console.log('');
71
+ output.success('Setup complete!');
72
+ }
73
+ const MIN_WRANGLER_VERSION = '3.0.0';
74
+ export function checkWranglerInstalled() {
75
+ try {
76
+ // Static command - no user input interpolation
77
+ const result = execSync('npx wrangler --version', {
78
+ encoding: 'utf-8',
79
+ stdio: ['pipe', 'pipe', 'pipe'],
80
+ }).trim();
81
+ // Extract version number from output like "wrangler 3.x.x" or " ⛅️ wrangler 3.x.x"
82
+ const match = result.match(/wrangler\s+(\d+\.\d+\.\d+)/i);
83
+ const version = match ? match[1] : null;
84
+ if (version && !isVersionAtLeast(version, MIN_WRANGLER_VERSION)) {
85
+ throw new CLIError(`Wrangler ${version} is too old. Minimum required: ${MIN_WRANGLER_VERSION}`, 'WRANGLER_VERSION_TOO_OLD', 2, 'Update wrangler: npm install -g wrangler@latest');
86
+ }
87
+ return version || result;
88
+ }
89
+ catch (error) {
90
+ if (error instanceof CLIError)
91
+ throw error;
92
+ throw new CLIError('Wrangler CLI is required but not installed', 'WRANGLER_NOT_FOUND', 2, 'Install wrangler: npm install -g wrangler');
93
+ }
94
+ }
95
+ function isVersionAtLeast(version, minimum) {
96
+ const v = version.split('.').map(Number);
97
+ const m = minimum.split('.').map(Number);
98
+ for (let i = 0; i < 3; i++) {
99
+ if ((v[i] || 0) > (m[i] || 0))
100
+ return true;
101
+ if ((v[i] || 0) < (m[i] || 0))
102
+ return false;
103
+ }
104
+ return true;
105
+ }
106
+ function getCloudflareAccountInfo() {
107
+ try {
108
+ const result = execSync('npx wrangler whoami', {
109
+ encoding: 'utf-8',
110
+ stdio: ['pipe', 'pipe', 'pipe'],
111
+ timeout: 30000,
112
+ });
113
+ if (!result.toLowerCase().includes('logged in')) {
114
+ return null;
115
+ }
116
+ // Strip trailing punctuation — wrangler ends with "." and some formats wrap in parens
117
+ const emailMatch = result.match(/associated with the email\s+(\S+)/);
118
+ const email = emailMatch
119
+ ? emailMatch[1].replace(/[.)]+$/, '')
120
+ : 'authenticated';
121
+ // Parse account table rows: │ Account Name │ 32-char-hex-id │
122
+ const accounts = [];
123
+ const rowRegex = /│\s+([^│]+?)\s+│\s+([a-f0-9]{32})\s+│/g;
124
+ let match;
125
+ while ((match = rowRegex.exec(result)) !== null) {
126
+ accounts.push({ name: match[1].trim(), id: match[2] });
127
+ }
128
+ return { email, accounts };
129
+ }
130
+ catch {
131
+ return null;
132
+ }
133
+ }
134
+ // Store selected account ID for zone filtering
135
+ let selectedAccountId = null;
136
+ async function verifyCloudflareAccount(skipPrompts) {
137
+ let info = getCloudflareAccountInfo();
138
+ if (!info) {
139
+ output.warn('Not logged in to Cloudflare.');
140
+ output.hint('Running: npx wrangler login');
141
+ console.log('');
142
+ execSync('npx wrangler login', { stdio: 'inherit' });
143
+ info = getCloudflareAccountInfo();
144
+ if (!info) {
145
+ // Token file may exist even if whoami parsing fails
146
+ if (!getCloudflareToken()) {
147
+ throw new CLIError('Cloudflare login failed or was cancelled', 'CLOUDFLARE_LOGIN_FAILED', 1);
148
+ }
149
+ output.success('Logged in to Cloudflare');
150
+ return;
151
+ }
152
+ }
153
+ await selectAndDisplayAccount(info, skipPrompts);
154
+ }
155
+ async function selectAndDisplayAccount(info, skipPrompts) {
156
+ output.success(`Logged in as: ${info.email}`);
157
+ if (info.accounts.length === 0) {
158
+ output.warn('Could not detect Cloudflare accounts. Zone filtering will be skipped.');
159
+ return;
160
+ }
161
+ const useFirstAccount = info.accounts.length === 1 || skipPrompts;
162
+ if (useFirstAccount) {
163
+ selectedAccountId = info.accounts[0].id;
164
+ const suffix = info.accounts.length > 1 ? ' (first available)' : '';
165
+ output.check(`Account: ${info.accounts[0].name}${suffix}`);
166
+ }
167
+ else {
168
+ selectedAccountId = await promptForAccount(info.accounts);
169
+ }
170
+ const zones = fetchCloudflareZones();
171
+ if (zones.length === 0) {
172
+ output.warn('No domains found in this account.');
173
+ output.hint('Add a domain in the Cloudflare dashboard before deploying.');
174
+ }
175
+ else {
176
+ output.check(`Domains: ${zones.length} available for Workers routing`);
177
+ }
178
+ }
179
+ async function promptForAccount(accounts) {
180
+ const choices = [
181
+ ...accounts.map((a) => ({
182
+ name: a.name,
183
+ value: a.id,
184
+ })),
185
+ { name: '[ Switch to different login ]', value: '__switch__' },
186
+ ];
187
+ const selected = await select({
188
+ message: 'Select the Cloudflare account to use:',
189
+ choices,
190
+ });
191
+ if (selected !== '__switch__') {
192
+ const selectedAccount = accounts.find((a) => a.id === selected);
193
+ output.success(`Using account: ${selectedAccount?.name || selected}`);
194
+ return selected;
195
+ }
196
+ // Switch login and re-prompt with new credentials
197
+ await switchCloudflareLogin();
198
+ const newInfo = getCloudflareAccountInfo();
199
+ if (!newInfo) {
200
+ if (!getCloudflareToken()) {
201
+ throw new CLIError('Cloudflare login failed or no accounts found', 'CLOUDFLARE_LOGIN_FAILED', 1);
202
+ }
203
+ output.success('Logged in to Cloudflare');
204
+ return '';
205
+ }
206
+ if (newInfo.accounts.length === 0) {
207
+ output.warn('Could not detect accounts after switching. Continuing without account filter.');
208
+ return '';
209
+ }
210
+ if (newInfo.accounts.length === 1) {
211
+ output.success(`Using account: ${newInfo.accounts[0].name}`);
212
+ return newInfo.accounts[0].id;
213
+ }
214
+ return promptForAccount(newInfo.accounts);
215
+ }
216
+ async function switchCloudflareLogin() {
217
+ output.hint('Switching accounts...');
218
+ execSync('npx wrangler logout', { stdio: 'inherit' });
219
+ console.log('');
220
+ execSync('npx wrangler login', { stdio: 'inherit' });
221
+ }
222
+ async function detectOrPromptSlug(skipPrompts) {
223
+ // Try to detect from docs.json in current directory
224
+ const docsJsonPath = path.join(process.cwd(), 'docs.json');
225
+ if (fs.existsSync(docsJsonPath)) {
226
+ try {
227
+ const config = await loadDocsConfig(docsJsonPath);
228
+ if (config?.name) {
229
+ // Convert name to slug format
230
+ const detectedSlug = config.name
231
+ .toLowerCase()
232
+ .replace(/\s+/g, '-')
233
+ .replace(/[^a-z0-9-]/g, '');
234
+ if (detectedSlug.length > 0) {
235
+ if (skipPrompts) {
236
+ return detectedSlug;
237
+ }
238
+ const useDetected = await confirm({
239
+ message: `Detected "${config.name}" from docs.json. Use "${detectedSlug}" as slug?`,
240
+ default: true,
241
+ });
242
+ if (useDetected) {
243
+ return detectedSlug;
244
+ }
245
+ }
246
+ }
247
+ }
248
+ catch {
249
+ // Ignore errors reading docs.json, fall through to prompt
250
+ }
251
+ }
252
+ // Prompt for slug (required even in --yes mode if not auto-detected)
253
+ return input({
254
+ message: 'Enter your Jamdesk project slug (e.g., "acme" for acme.jamdesk.app):',
255
+ validate: (value) => {
256
+ if (!value.trim())
257
+ return 'Slug is required';
258
+ if (!/^[a-z0-9-]+$/.test(value)) {
259
+ return 'Slug must contain only lowercase letters, numbers, and hyphens';
260
+ }
261
+ return true;
262
+ },
263
+ });
264
+ }
265
+ async function gatherConfiguration(options, slug) {
266
+ const domain = options.domain ||
267
+ (await input({
268
+ message: 'Enter your target domain (e.g., yoursite.com):',
269
+ validate: (value) => {
270
+ if (!value.trim())
271
+ return 'Domain is required';
272
+ if (!/^[a-z0-9][a-z0-9.-]+\.[a-z]{2,}$/i.test(value)) {
273
+ return 'Please enter a valid domain (e.g., yoursite.com)';
274
+ }
275
+ return true;
276
+ },
277
+ }));
278
+ const pathPrefix = options.path || (await getPathPrefix(options.yes));
279
+ // Extract root domain as default (handles subdomains like docs.example.com -> example.com)
280
+ const rootDomain = extractRootDomain(domain);
281
+ const zoneName = options.yes
282
+ ? rootDomain
283
+ : await selectOrInputZone(rootDomain);
284
+ return { slug, domain, pathPrefix, zoneName };
285
+ }
286
+ async function selectOrInputZone(defaultZone) {
287
+ // Try to fetch available zones from Cloudflare
288
+ const zones = fetchCloudflareZones();
289
+ if (zones.length === 0) {
290
+ // No zones found or not logged in - fall back to manual input
291
+ return input({
292
+ message: 'Enter the Cloudflare zone name (root domain, e.g., "example.com" even for subdomains):',
293
+ default: defaultZone,
294
+ });
295
+ }
296
+ // Add "Enter manually" option
297
+ const choices = [
298
+ ...zones.map((z) => ({
299
+ name: `${z.name}${z.status !== 'active' ? ` (${z.status})` : ''}`,
300
+ value: z.name,
301
+ })),
302
+ { name: '[ Enter manually ]', value: '__manual__' },
303
+ ];
304
+ const selected = await select({
305
+ message: 'Select your Cloudflare zone (this must match a zone in your Cloudflare account):',
306
+ choices,
307
+ });
308
+ if (selected === '__manual__') {
309
+ return input({
310
+ message: 'Enter the Cloudflare zone name:',
311
+ default: defaultZone,
312
+ });
313
+ }
314
+ return selected;
315
+ }
316
+ function getCloudflareToken() {
317
+ try {
318
+ const configPath = path.join(process.env.HOME || process.env.USERPROFILE || '', '.wrangler', 'config', 'default.toml');
319
+ if (!fs.existsSync(configPath))
320
+ return null;
321
+ const content = fs.readFileSync(configPath, 'utf-8');
322
+ const match = content.match(/oauth_token\s*=\s*"([^"]+)"/);
323
+ return match ? match[1] : null;
324
+ }
325
+ catch {
326
+ return null;
327
+ }
328
+ }
329
+ function fetchCloudflareZones() {
330
+ try {
331
+ const token = getCloudflareToken();
332
+ if (!token)
333
+ return [];
334
+ // Build URL with optional account filter
335
+ let zonesUrl = 'https://api.cloudflare.com/client/v4/zones?per_page=50';
336
+ if (selectedAccountId) {
337
+ zonesUrl += `&account.id=${selectedAccountId}`;
338
+ }
339
+ // Use curl to fetch zones from Cloudflare API (static command, token not interpolated into shell)
340
+ const result = execSync(`curl -s -H "Authorization: Bearer $CF_TOKEN" "${zonesUrl}"`, {
341
+ encoding: 'utf-8',
342
+ stdio: ['pipe', 'pipe', 'pipe'],
343
+ timeout: 15000,
344
+ env: { ...process.env, CF_TOKEN: token },
345
+ });
346
+ const response = JSON.parse(result);
347
+ if (response.success && response.result) {
348
+ return response.result.filter((z) => z.name && z.id);
349
+ }
350
+ return [];
351
+ }
352
+ catch {
353
+ // Not logged in, network error, or other issue - return empty array
354
+ return [];
355
+ }
356
+ }
357
+ async function getPathPrefix(skipPrompts) {
358
+ if (skipPrompts) {
359
+ return '/docs';
360
+ }
361
+ return input({
362
+ message: 'Enter the path prefix:',
363
+ default: '/docs',
364
+ validate: (value) => {
365
+ if (!value.startsWith('/'))
366
+ return 'Path must start with /';
367
+ return true;
368
+ },
369
+ });
370
+ }
371
+ async function generateFiles(config, outputDir) {
372
+ const spin = spinner('Generating files...');
373
+ try {
374
+ await fs.ensureDir(outputDir);
375
+ const files = [
376
+ ['index.js', generateWorkerCode(config)],
377
+ ['wrangler.toml', generateWranglerConfig(config)],
378
+ ['package.json', generatePackageJson(config)],
379
+ ['.gitignore', generateGitignore()],
380
+ ];
381
+ await Promise.all(files.map(([name, content]) => fs.writeFile(path.join(outputDir, name), content)));
382
+ spin.succeed('Files generated');
383
+ for (const [name] of files) {
384
+ output.check(`Created ${outputDir}/${name}`);
385
+ }
386
+ }
387
+ catch (error) {
388
+ spin.fail('Failed to generate files');
389
+ throw new CLIError(`Failed to write files: ${error instanceof Error ? error.message : String(error)}`, 'FILE_WRITE_ERROR', 1);
390
+ }
391
+ }
392
+ async function deployWorker(outputDir) {
393
+ const spin = spinner('Deploying to Cloudflare...');
394
+ try {
395
+ // Static command - user input passed via cwd, not interpolated
396
+ execSync('npx wrangler deploy', {
397
+ cwd: outputDir,
398
+ stdio: 'inherit',
399
+ });
400
+ spin.succeed('Deployed successfully');
401
+ }
402
+ catch {
403
+ spin.fail('Deployment failed');
404
+ output.error('Wrangler deploy failed. You can deploy manually:');
405
+ output.hint(` cd ${outputDir}`);
406
+ output.hint(' npx wrangler deploy');
407
+ }
408
+ }
409
+ //# sourceMappingURL=cloudflare.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloudflare.js","sourceRoot":"","sources":["../../../src/commands/deploy/cloudflare.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AAG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,KAAK,UAAU,YAAY,CAAC,SAAiB;IAC3C,MAAM,IAAI,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;IAEnD,IAAI,CAAC;QACH,+DAA+D;QAC/D,QAAQ,CAAC,qBAAqB,EAAE;YAC9B,GAAG,EAAE,SAAS;YACd,KAAK,EAAE,SAAS;SACjB,CAAC,CAAC;QACH,IAAI,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;QAC/B,MAAM,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;QACjE,MAAM,CAAC,IAAI,CAAC,QAAQ,SAAS,EAAE,CAAC,CAAC;QACjC,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;IACvC,CAAC;AACH,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Cloudflare Worker Templates
3
+ *
4
+ * Generates the worker code, wrangler.toml, and package.json.
5
+ */
6
+ import type { CloudflareConfig } from './types.js';
7
+ export declare function generateWorkerCode(config: CloudflareConfig): string;
8
+ export declare function generateWranglerConfig(config: CloudflareConfig): string;
9
+ export declare function generatePackageJson(config: CloudflareConfig): string;
10
+ /**
11
+ * Generate a .gitignore file for the worker directory.
12
+ */
13
+ export declare function generateGitignore(): string;
14
+ /**
15
+ * Extract root domain from a full domain.
16
+ * Handles both simple TLDs (example.com) and multi-part TLDs (example.co.uk).
17
+ *
18
+ * @example
19
+ * extractRootDomain("docs.example.com") // "example.com"
20
+ * extractRootDomain("api.docs.example.co.uk") // "example.co.uk"
21
+ */
22
+ export declare function extractRootDomain(domain: string): string;
23
+ //# sourceMappingURL=templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/commands/deploy/templates.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAgEnE;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAuBvE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAqBpE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAK1C;AAsCD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAexD"}