@cedarjs/cli 0.0.4

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 (360) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +706 -0
  3. package/dist/commands/build.js +54 -0
  4. package/dist/commands/buildHandler.js +134 -0
  5. package/dist/commands/check.js +28 -0
  6. package/dist/commands/console.js +13 -0
  7. package/dist/commands/consoleHandler.js +68 -0
  8. package/dist/commands/deploy/baremetal/SshExecutor.js +41 -0
  9. package/dist/commands/deploy/baremetal/baremetalHandler.js +558 -0
  10. package/dist/commands/deploy/baremetal.js +89 -0
  11. package/dist/commands/deploy/flightcontrol.js +40 -0
  12. package/dist/commands/deploy/flightcontrolHandler.js +58 -0
  13. package/dist/commands/deploy/helpers/deployBuilder.js +25 -0
  14. package/dist/commands/deploy/helpers/deployHandler.js +31 -0
  15. package/dist/commands/deploy/netlify.js +21 -0
  16. package/dist/commands/deploy/packing/nft.js +61 -0
  17. package/dist/commands/deploy/render.js +37 -0
  18. package/dist/commands/deploy/renderHandler.js +70 -0
  19. package/dist/commands/deploy/serverless.js +51 -0
  20. package/dist/commands/deploy/serverlessHandler.js +211 -0
  21. package/dist/commands/deploy/vercel.js +21 -0
  22. package/dist/commands/deploy.js +21 -0
  23. package/dist/commands/destroy/cell/cell.js +12 -0
  24. package/dist/commands/destroy/cell/cellHandler.js +10 -0
  25. package/dist/commands/destroy/component/component.js +15 -0
  26. package/dist/commands/destroy/component/componentHandler.js +10 -0
  27. package/dist/commands/destroy/directive/directive.js +14 -0
  28. package/dist/commands/destroy/directive/directiveHandler.js +12 -0
  29. package/dist/commands/destroy/function/function.js +20 -0
  30. package/dist/commands/destroy/function/functionHandler.js +10 -0
  31. package/dist/commands/destroy/handlerHelpers.js +34 -0
  32. package/dist/commands/destroy/helpers.js +22 -0
  33. package/dist/commands/destroy/layout/layout.js +12 -0
  34. package/dist/commands/destroy/layout/layoutHandler.js +10 -0
  35. package/dist/commands/destroy/page/page.js +20 -0
  36. package/dist/commands/destroy/page/pageHandler.js +51 -0
  37. package/dist/commands/destroy/scaffold/scaffold.js +16 -0
  38. package/dist/commands/destroy/scaffold/scaffoldHandler.js +105 -0
  39. package/dist/commands/destroy/sdl/sdl.js +16 -0
  40. package/dist/commands/destroy/sdl/sdlHandler.js +33 -0
  41. package/dist/commands/destroy/service/service.js +10 -0
  42. package/dist/commands/destroy/service/serviceHandler.js +17 -0
  43. package/dist/commands/destroy.js +25 -0
  44. package/dist/commands/dev.js +47 -0
  45. package/dist/commands/devHandler.js +202 -0
  46. package/dist/commands/exec.js +38 -0
  47. package/dist/commands/execHandler.js +180 -0
  48. package/dist/commands/experimental/setupInngest.js +28 -0
  49. package/dist/commands/experimental/setupInngestHandler.js +46 -0
  50. package/dist/commands/experimental/setupOpentelemetry.js +34 -0
  51. package/dist/commands/experimental/setupOpentelemetryHandler.js +215 -0
  52. package/dist/commands/experimental/setupReactCompiler.js +28 -0
  53. package/dist/commands/experimental/setupReactCompilerHandler.js +124 -0
  54. package/dist/commands/experimental/setupRsc.js +28 -0
  55. package/dist/commands/experimental/setupRscHandler.js +408 -0
  56. package/dist/commands/experimental/setupStreamingSsr.js +28 -0
  57. package/dist/commands/experimental/setupStreamingSsrHandler.js +208 -0
  58. package/dist/commands/experimental/templates/opentelemetry.ts.template +55 -0
  59. package/dist/commands/experimental/templates/rsc/AboutCounter.tsx.template +20 -0
  60. package/dist/commands/experimental/templates/rsc/AboutPage.css.template +2 -0
  61. package/dist/commands/experimental/templates/rsc/AboutPage.tsx.template +17 -0
  62. package/dist/commands/experimental/templates/rsc/Counter.css.template +7 -0
  63. package/dist/commands/experimental/templates/rsc/Counter.module.css.template +3 -0
  64. package/dist/commands/experimental/templates/rsc/Counter.tsx.template +18 -0
  65. package/dist/commands/experimental/templates/rsc/Document.tsx.template +27 -0
  66. package/dist/commands/experimental/templates/rsc/HomePage.css.template +2 -0
  67. package/dist/commands/experimental/templates/rsc/HomePage.module.css.template +3 -0
  68. package/dist/commands/experimental/templates/rsc/HomePage.tsx.template +19 -0
  69. package/dist/commands/experimental/templates/rsc/NavigationLayout.css.template +32 -0
  70. package/dist/commands/experimental/templates/rsc/NavigationLayout.tsx.template +31 -0
  71. package/dist/commands/experimental/templates/rsc/Routes.tsx.template +29 -0
  72. package/dist/commands/experimental/templates/rsc/entry.client.tsx.template +35 -0
  73. package/dist/commands/experimental/templates/rsc/entry.server.tsx.template +20 -0
  74. package/dist/commands/experimental/templates/rsc/index.css.template +4 -0
  75. package/dist/commands/experimental/templates/streamingSsr/Document.tsx.template +27 -0
  76. package/dist/commands/experimental/templates/streamingSsr/entry.client.tsx.template +40 -0
  77. package/dist/commands/experimental/templates/streamingSsr/entry.server.tsx.template +20 -0
  78. package/dist/commands/experimental/templates/streamingSsr/tsconfig.json.template +54 -0
  79. package/dist/commands/experimental/util.js +69 -0
  80. package/dist/commands/experimental.js +22 -0
  81. package/dist/commands/generate/cell/cell.js +35 -0
  82. package/dist/commands/generate/cell/cellHandler.js +153 -0
  83. package/dist/commands/generate/cell/templates/cell.tsx.template +34 -0
  84. package/dist/commands/generate/cell/templates/cellList.tsx.template +40 -0
  85. package/dist/commands/generate/cell/templates/mock.ts.template +7 -0
  86. package/dist/commands/generate/cell/templates/mockList.ts.template +14 -0
  87. package/dist/commands/generate/cell/templates/stories.tsx.template +35 -0
  88. package/dist/commands/generate/cell/templates/test.js.template +42 -0
  89. package/dist/commands/generate/cell/utils/utils.js +43 -0
  90. package/dist/commands/generate/component/component.js +15 -0
  91. package/dist/commands/generate/component/componentHandler.js +55 -0
  92. package/dist/commands/generate/component/templates/component.tsx.template +10 -0
  93. package/dist/commands/generate/component/templates/stories.jsx.template +17 -0
  94. package/dist/commands/generate/component/templates/stories.tsx.template +26 -0
  95. package/dist/commands/generate/component/templates/test.tsx.template +14 -0
  96. package/dist/commands/generate/dataMigration/dataMigration.js +105 -0
  97. package/dist/commands/generate/dataMigration/templates/dataMigration.js.template +7 -0
  98. package/dist/commands/generate/dataMigration/templates/dataMigration.ts.template +5 -0
  99. package/dist/commands/generate/dbAuth/dbAuth.js +55 -0
  100. package/dist/commands/generate/dbAuth/dbAuthHandler.js +375 -0
  101. package/dist/commands/generate/dbAuth/templates/forgotPassword.tsx.template +94 -0
  102. package/dist/commands/generate/dbAuth/templates/login.tsx.template +130 -0
  103. package/dist/commands/generate/dbAuth/templates/login.webAuthn.tsx.template +264 -0
  104. package/dist/commands/generate/dbAuth/templates/resetPassword.tsx.template +121 -0
  105. package/dist/commands/generate/dbAuth/templates/signup.tsx.template +123 -0
  106. package/dist/commands/generate/directive/directive.js +15 -0
  107. package/dist/commands/generate/directive/directiveHandler.js +159 -0
  108. package/dist/commands/generate/directive/templates/transformer.directive.test.ts.template +18 -0
  109. package/dist/commands/generate/directive/templates/transformer.directive.ts.template +38 -0
  110. package/dist/commands/generate/directive/templates/validator.directive.test.ts.template +17 -0
  111. package/dist/commands/generate/directive/templates/validator.directive.ts.template +39 -0
  112. package/dist/commands/generate/function/function.js +29 -0
  113. package/dist/commands/generate/function/functionHandler.js +131 -0
  114. package/dist/commands/generate/function/templates/function.ts.template +33 -0
  115. package/dist/commands/generate/function/templates/scenarios.ts.template +8 -0
  116. package/dist/commands/generate/function/templates/test.ts.template +30 -0
  117. package/dist/commands/generate/helpers.js +71 -0
  118. package/dist/commands/generate/job/job.js +39 -0
  119. package/dist/commands/generate/job/jobHandler.js +138 -0
  120. package/dist/commands/generate/job/templates/job.ts.template +8 -0
  121. package/dist/commands/generate/job/templates/scenarios.ts.template +8 -0
  122. package/dist/commands/generate/job/templates/test.ts.template +7 -0
  123. package/dist/commands/generate/layout/layout.js +25 -0
  124. package/dist/commands/generate/layout/layoutHandler.js +59 -0
  125. package/dist/commands/generate/layout/templates/layout.tsx.a11y.template +27 -0
  126. package/dist/commands/generate/layout/templates/layout.tsx.template +9 -0
  127. package/dist/commands/generate/layout/templates/stories.tsx.template +13 -0
  128. package/dist/commands/generate/layout/templates/test.tsx.template +14 -0
  129. package/dist/commands/generate/model/model.js +29 -0
  130. package/dist/commands/generate/model/modelHandler.js +63 -0
  131. package/dist/commands/generate/model/templates/model.js.template +3 -0
  132. package/dist/commands/generate/ogImage/ogImage.js +43 -0
  133. package/dist/commands/generate/ogImage/ogImageHandler.js +111 -0
  134. package/dist/commands/generate/ogImage/templates/ogImage.og.tsx.template +13 -0
  135. package/dist/commands/generate/page/page.js +22 -0
  136. package/dist/commands/generate/page/pageHandler.js +227 -0
  137. package/dist/commands/generate/page/templates/page.tsx.template +35 -0
  138. package/dist/commands/generate/page/templates/stories.tsx.parameters.template +13 -0
  139. package/dist/commands/generate/page/templates/stories.tsx.template +13 -0
  140. package/dist/commands/generate/page/templates/test.tsx.template +14 -0
  141. package/dist/commands/generate/realtime/realtime.js +41 -0
  142. package/dist/commands/generate/realtime/realtimeHandler.js +215 -0
  143. package/dist/commands/generate/realtime/templates/liveQueries/blank/blank.sdl.ts.template +27 -0
  144. package/dist/commands/generate/realtime/templates/liveQueries/blank/blank.service.ts.template +73 -0
  145. package/dist/commands/generate/realtime/templates/realtime.ts.template +42 -0
  146. package/dist/commands/generate/realtime/templates/subscriptions/blank/blank.sdl.ts.template +20 -0
  147. package/dist/commands/generate/realtime/templates/subscriptions/blank/blank.service.ts.template +19 -0
  148. package/dist/commands/generate/realtime/templates/subscriptions/blank/blank.ts.template +58 -0
  149. package/dist/commands/generate/scaffold/scaffold.js +38 -0
  150. package/dist/commands/generate/scaffold/scaffoldHandler.js +663 -0
  151. package/dist/commands/generate/scaffold/templates/assets/scaffold.css.template +398 -0
  152. package/dist/commands/generate/scaffold/templates/assets/scaffold.tailwind.css.template +243 -0
  153. package/dist/commands/generate/scaffold/templates/components/EditNameCell.tsx.template +74 -0
  154. package/dist/commands/generate/scaffold/templates/components/Name.tsx.template +79 -0
  155. package/dist/commands/generate/scaffold/templates/components/NameCell.tsx.template +32 -0
  156. package/dist/commands/generate/scaffold/templates/components/NameForm.tsx.template +123 -0
  157. package/dist/commands/generate/scaffold/templates/components/Names.tsx.template +88 -0
  158. package/dist/commands/generate/scaffold/templates/components/NamesCell.tsx.template +45 -0
  159. package/dist/commands/generate/scaffold/templates/components/NewName.tsx.template +55 -0
  160. package/dist/commands/generate/scaffold/templates/layouts/ScaffoldLayout.tsx.template +37 -0
  161. package/dist/commands/generate/scaffold/templates/lib/formatters.test.tsx.template +192 -0
  162. package/dist/commands/generate/scaffold/templates/lib/formatters.tsx.template +58 -0
  163. package/dist/commands/generate/scaffold/templates/pages/EditNamePage.tsx.template +11 -0
  164. package/dist/commands/generate/scaffold/templates/pages/NamePage.tsx.template +11 -0
  165. package/dist/commands/generate/scaffold/templates/pages/NamesPage.tsx.template +7 -0
  166. package/dist/commands/generate/scaffold/templates/pages/NewNamePage.tsx.template +7 -0
  167. package/dist/commands/generate/script/script.js +29 -0
  168. package/dist/commands/generate/script/scriptHandler.js +85 -0
  169. package/dist/commands/generate/script/templates/script.ts.template +15 -0
  170. package/dist/commands/generate/script/templates/tsconfig.json.template +33 -0
  171. package/dist/commands/generate/sdl/sdl.js +48 -0
  172. package/dist/commands/generate/sdl/sdlHandler.js +282 -0
  173. package/dist/commands/generate/sdl/templates/sdl.js.template +70 -0
  174. package/dist/commands/generate/sdl/templates/sdl.ts.template +70 -0
  175. package/dist/commands/generate/secret/secret.js +52 -0
  176. package/dist/commands/generate/service/service.js +50 -0
  177. package/dist/commands/generate/service/serviceHandler.js +301 -0
  178. package/dist/commands/generate/service/templates/scenarios.ts.template +7 -0
  179. package/dist/commands/generate/service/templates/service.ts.template +38 -0
  180. package/dist/commands/generate/service/templates/test.ts.template +84 -0
  181. package/dist/commands/generate/yargsCommandHelpers.js +77 -0
  182. package/dist/commands/generate/yargsHandlerHelpers.js +155 -0
  183. package/dist/commands/generate.js +44 -0
  184. package/dist/commands/info.js +36 -0
  185. package/dist/commands/jobs.js +17 -0
  186. package/dist/commands/jobsHandler.js +30 -0
  187. package/dist/commands/lint.js +57 -0
  188. package/dist/commands/prerender.js +34 -0
  189. package/dist/commands/prerenderHandler.js +282 -0
  190. package/dist/commands/prisma.js +17 -0
  191. package/dist/commands/prismaHandler.js +90 -0
  192. package/dist/commands/record/init.js +11 -0
  193. package/dist/commands/record.js +19 -0
  194. package/dist/commands/serve.js +139 -0
  195. package/dist/commands/serveApiHandler.js +15 -0
  196. package/dist/commands/serveBothHandler.js +95 -0
  197. package/dist/commands/serveWebHandler.js +17 -0
  198. package/dist/commands/setup/auth/auth.js +265 -0
  199. package/dist/commands/setup/cache/cache.js +37 -0
  200. package/dist/commands/setup/cache/cacheHandler.js +69 -0
  201. package/dist/commands/setup/cache/templates/memcached.ts.template +30 -0
  202. package/dist/commands/setup/cache/templates/redis.ts.template +24 -0
  203. package/dist/commands/setup/deploy/deploy.js +26 -0
  204. package/dist/commands/setup/deploy/helpers/helpers.js +9 -0
  205. package/dist/commands/setup/deploy/helpers/index.js +110 -0
  206. package/dist/commands/setup/deploy/providers/baremetal.js +9 -0
  207. package/dist/commands/setup/deploy/providers/baremetalHandler.js +64 -0
  208. package/dist/commands/setup/deploy/providers/coherence.js +24 -0
  209. package/dist/commands/setup/deploy/providers/coherenceHandler.js +203 -0
  210. package/dist/commands/setup/deploy/providers/flightcontrol.js +19 -0
  211. package/dist/commands/setup/deploy/providers/flightcontrolHandler.js +294 -0
  212. package/dist/commands/setup/deploy/providers/netlify.js +9 -0
  213. package/dist/commands/setup/deploy/providers/netlifyHandler.js +42 -0
  214. package/dist/commands/setup/deploy/providers/render.js +17 -0
  215. package/dist/commands/setup/deploy/providers/renderHandler.js +111 -0
  216. package/dist/commands/setup/deploy/providers/serverless.js +11 -0
  217. package/dist/commands/setup/deploy/providers/serverlessHandler.js +141 -0
  218. package/dist/commands/setup/deploy/providers/vercel.js +9 -0
  219. package/dist/commands/setup/deploy/providers/vercelHandler.js +56 -0
  220. package/dist/commands/setup/deploy/templates/baremetal.js +128 -0
  221. package/dist/commands/setup/deploy/templates/flightcontrol.js +85 -0
  222. package/dist/commands/setup/deploy/templates/netlify.js +32 -0
  223. package/dist/commands/setup/deploy/templates/render.js +72 -0
  224. package/dist/commands/setup/deploy/templates/serverless/api.js +78 -0
  225. package/dist/commands/setup/deploy/templates/serverless/web.js +32 -0
  226. package/dist/commands/setup/docker/docker.js +26 -0
  227. package/dist/commands/setup/docker/dockerHandler.js +265 -0
  228. package/dist/commands/setup/docker/templates/Dockerfile +154 -0
  229. package/dist/commands/setup/docker/templates/docker-compose.dev.yml +58 -0
  230. package/dist/commands/setup/docker/templates/docker-compose.prod.yml +63 -0
  231. package/dist/commands/setup/docker/templates/dockerignore +18 -0
  232. package/dist/commands/setup/generator/generator.js +49 -0
  233. package/dist/commands/setup/generator/generatorHandler.js +55 -0
  234. package/dist/commands/setup/graphql/features/fragments/appGqlConfigTransform.js +117 -0
  235. package/dist/commands/setup/graphql/features/fragments/appImportTransform.js +20 -0
  236. package/dist/commands/setup/graphql/features/fragments/fragments.js +25 -0
  237. package/dist/commands/setup/graphql/features/fragments/fragmentsHandler.js +89 -0
  238. package/dist/commands/setup/graphql/features/trustedDocuments/graphqlTransform.js +51 -0
  239. package/dist/commands/setup/graphql/features/trustedDocuments/trustedDocuments.js +25 -0
  240. package/dist/commands/setup/graphql/features/trustedDocuments/trustedDocumentsHandler.js +74 -0
  241. package/dist/commands/setup/graphql/graphql.js +18 -0
  242. package/dist/commands/setup/i18n/i18n.js +25 -0
  243. package/dist/commands/setup/i18n/i18nHandler.js +169 -0
  244. package/dist/commands/setup/i18n/templates/en.json.template +11 -0
  245. package/dist/commands/setup/i18n/templates/fr.json.template +11 -0
  246. package/dist/commands/setup/i18n/templates/i18n.js.template +52 -0
  247. package/dist/commands/setup/i18n/templates/storybook.preview.tsx.template +43 -0
  248. package/dist/commands/setup/jobs/jobs.js +31 -0
  249. package/dist/commands/setup/jobs/jobsHandler.js +122 -0
  250. package/dist/commands/setup/jobs/templates/jobs.ts.template +32 -0
  251. package/dist/commands/setup/mailer/mailer.js +30 -0
  252. package/dist/commands/setup/mailer/mailerHandler.js +106 -0
  253. package/dist/commands/setup/mailer/templates/mailer.ts.template +30 -0
  254. package/dist/commands/setup/mailer/templates/re-example.tsx.template +40 -0
  255. package/dist/commands/setup/middleware/middleware.js +17 -0
  256. package/dist/commands/setup/middleware/ogImage/__codemod_tests__/middleware.js +15 -0
  257. package/dist/commands/setup/middleware/ogImage/__codemod_tests__/vitePlugin.js +6 -0
  258. package/dist/commands/setup/middleware/ogImage/codemodMiddleware.js +97 -0
  259. package/dist/commands/setup/middleware/ogImage/codemodVitePlugin.js +65 -0
  260. package/dist/commands/setup/middleware/ogImage/ogImage.js +27 -0
  261. package/dist/commands/setup/middleware/ogImage/ogImageHandler.js +121 -0
  262. package/dist/commands/setup/monitoring/monitoring.js +17 -0
  263. package/dist/commands/setup/monitoring/sentry/sentry.js +25 -0
  264. package/dist/commands/setup/monitoring/sentry/sentryHandler.js +163 -0
  265. package/dist/commands/setup/monitoring/sentry/templates/sentryApi.ts.template +15 -0
  266. package/dist/commands/setup/monitoring/sentry/templates/sentryWeb.ts.template +31 -0
  267. package/dist/commands/setup/package/package.js +33 -0
  268. package/dist/commands/setup/package/packageHandler.js +134 -0
  269. package/dist/commands/setup/realtime/realtime.js +37 -0
  270. package/dist/commands/setup/realtime/realtimeHandler.js +309 -0
  271. package/dist/commands/setup/realtime/templates/defer/fastAndSlowFields/fastAndSlowFields.sdl.template +14 -0
  272. package/dist/commands/setup/realtime/templates/defer/fastAndSlowFields/fastAndSlowFields.ts.template +14 -0
  273. package/dist/commands/setup/realtime/templates/liveQueries/auctions/auctions.sdl.ts.template +27 -0
  274. package/dist/commands/setup/realtime/templates/liveQueries/auctions/auctions.ts.template +73 -0
  275. package/dist/commands/setup/realtime/templates/realtime.ts.template +46 -0
  276. package/dist/commands/setup/realtime/templates/stream/alphabet/alphabet.sdl.template +9 -0
  277. package/dist/commands/setup/realtime/templates/stream/alphabet/alphabet.ts.template +31 -0
  278. package/dist/commands/setup/realtime/templates/subscriptions/countdown/countdown.ts.template +58 -0
  279. package/dist/commands/setup/realtime/templates/subscriptions/newMessage/newMessage.ts.template +57 -0
  280. package/dist/commands/setup/realtime/templates/subscriptions/newMessage/rooms.sdl.ts.template +20 -0
  281. package/dist/commands/setup/realtime/templates/subscriptions/newMessage/rooms.ts.template +20 -0
  282. package/dist/commands/setup/server-file/serverFile.js +31 -0
  283. package/dist/commands/setup/server-file/serverFileHandler.js +56 -0
  284. package/dist/commands/setup/server-file/templates/server.ts.template +13 -0
  285. package/dist/commands/setup/tsconfig/tsconfig.js +25 -0
  286. package/dist/commands/setup/tsconfig/tsconfigHandler.js +59 -0
  287. package/dist/commands/setup/ui/helpers/helpers.js +9 -0
  288. package/dist/commands/setup/ui/libraries/chakra-ui.js +24 -0
  289. package/dist/commands/setup/ui/libraries/chakra-uiHandler.js +98 -0
  290. package/dist/commands/setup/ui/libraries/mantine.js +32 -0
  291. package/dist/commands/setup/ui/libraries/mantineHandler.js +138 -0
  292. package/dist/commands/setup/ui/libraries/tailwindcss.js +26 -0
  293. package/dist/commands/setup/ui/libraries/tailwindcssHandler.js +386 -0
  294. package/dist/commands/setup/ui/templates/chakra.storybook.preview.tsx.template +20 -0
  295. package/dist/commands/setup/ui/templates/mantine-postcss.config.js.template +35 -0
  296. package/dist/commands/setup/ui/templates/mantine.storybook.preview.tsx.template +18 -0
  297. package/dist/commands/setup/ui/templates/postcss.config.js.template +9 -0
  298. package/dist/commands/setup/ui/ui.js +17 -0
  299. package/dist/commands/setup/uploads/dbCodemod.js +28 -0
  300. package/dist/commands/setup/uploads/templates/signedUrl.ts.template +21 -0
  301. package/dist/commands/setup/uploads/templates/srcLibUploads.ts.template +25 -0
  302. package/dist/commands/setup/uploads/uploads.js +26 -0
  303. package/dist/commands/setup/uploads/uploadsHandler.js +147 -0
  304. package/dist/commands/setup/vite/templates/vite.config.ts.template +19 -0
  305. package/dist/commands/setup/vite/vite.js +38 -0
  306. package/dist/commands/setup/vite/viteHandler.js +83 -0
  307. package/dist/commands/setup.js +33 -0
  308. package/dist/commands/studio.js +23 -0
  309. package/dist/commands/studioHandler.js +61 -0
  310. package/dist/commands/test.js +44 -0
  311. package/dist/commands/testHandler.js +138 -0
  312. package/dist/commands/ts-to-js.js +20 -0
  313. package/dist/commands/type-check.js +41 -0
  314. package/dist/commands/type-checkHandler.js +71 -0
  315. package/dist/commands/upgrade.js +441 -0
  316. package/dist/index.d.js +0 -0
  317. package/dist/index.js +146 -0
  318. package/dist/lib/background.js +45 -0
  319. package/dist/lib/colors.js +18 -0
  320. package/dist/lib/configureStorybook.js +50 -0
  321. package/dist/lib/exec.js +85 -0
  322. package/dist/lib/exit.js +44 -0
  323. package/dist/lib/extendFile.js +114 -0
  324. package/dist/lib/generatePrismaClient.js +60 -0
  325. package/dist/lib/index.js +485 -0
  326. package/dist/lib/loadEnvFiles.js +12 -0
  327. package/dist/lib/locking.js +60 -0
  328. package/dist/lib/merge/algorithms.js +30 -0
  329. package/dist/lib/merge/index.js +163 -0
  330. package/dist/lib/merge/semanticIdentity.js +18 -0
  331. package/dist/lib/merge/strategy.js +136 -0
  332. package/dist/lib/mockTelemetry.js +7 -0
  333. package/dist/lib/packages.js +77 -0
  334. package/dist/lib/plugin.js +206 -0
  335. package/dist/lib/pluralHelpers.js +50 -0
  336. package/dist/lib/ports.js +17 -0
  337. package/dist/lib/project.js +30 -0
  338. package/dist/lib/rollback.js +72 -0
  339. package/dist/lib/runTransform.js +66 -0
  340. package/dist/lib/rwPluralize.js +56 -0
  341. package/dist/lib/schemaHelpers.js +95 -0
  342. package/dist/lib/templates/storybook.preview.tsx.template +19 -0
  343. package/dist/lib/test.js +106 -0
  344. package/dist/lib/updateCheck.js +202 -0
  345. package/dist/lib/updateCheckExecute.js +2 -0
  346. package/dist/middleware/checkNodeVersion.js +23 -0
  347. package/dist/middleware/detectProjectRxVersion.js +12 -0
  348. package/dist/plugin.js +223 -0
  349. package/dist/rwfw.js +47 -0
  350. package/dist/telemetry/exporter.js +63 -0
  351. package/dist/telemetry/index.js +84 -0
  352. package/dist/telemetry/resource.js +98 -0
  353. package/dist/telemetry/send.js +80 -0
  354. package/dist/testLib/cells.js +188 -0
  355. package/dist/testLib/fetchFileFromTemplate.js +9 -0
  356. package/dist/testLib/getFilesWithPattern.js +21 -0
  357. package/dist/testLib/getRootPackageJSON.js +14 -0
  358. package/dist/testLib/isTSProject.js +9 -0
  359. package/dist/testLib/runTransform.js +42 -0
  360. package/package.json +102 -0
@@ -0,0 +1,69 @@
1
+ import path from "path";
2
+ import fs from "fs-extra";
3
+ import { Listr } from "listr2";
4
+ import { addEnvVarTask } from "@cedarjs/cli-helpers";
5
+ import { errorTelemetry } from "@cedarjs/telemetry";
6
+ import c from "../../../lib/colors.js";
7
+ import { addPackagesTask, getPaths, writeFile } from "../../../lib/index.js";
8
+ import { isTypeScriptProject } from "../../../lib/project.js";
9
+ const CLIENT_PACKAGE_MAP = {
10
+ memcached: "memjs",
11
+ redis: "redis"
12
+ };
13
+ const CLIENT_HOST_MAP = {
14
+ memcached: "localhost:11211",
15
+ redis: "redis://localhost:6379"
16
+ };
17
+ const handler = async ({ client, force }) => {
18
+ const extension = isTypeScriptProject ? "ts" : "js";
19
+ const tasks = new Listr([
20
+ await addPackagesTask({
21
+ packages: [CLIENT_PACKAGE_MAP[client]],
22
+ side: "api"
23
+ }),
24
+ {
25
+ title: `Writing api/src/lib/cache.js`,
26
+ task: () => {
27
+ const template = fs.readFileSync(
28
+ path.join(
29
+ import.meta.dirname,
30
+ "templates",
31
+ `${client}.ts.template`
32
+ )
33
+ ).toString();
34
+ return writeFile(
35
+ path.join(getPaths().api.lib, `cache.${extension}`),
36
+ template,
37
+ {
38
+ overwriteExisting: force
39
+ }
40
+ );
41
+ }
42
+ },
43
+ addEnvVarTask(
44
+ "CACHE_HOST",
45
+ CLIENT_HOST_MAP[client],
46
+ `Where your ${client} server lives for service caching`
47
+ ),
48
+ {
49
+ title: "One more thing...",
50
+ task: (_ctx, task) => {
51
+ task.title = `One more thing...
52
+
53
+ ${c.tip("Check out the Service Cache docs for config and usage:")}
54
+ ${c.link("https://redwoodjs.com/docs/services#caching")}
55
+ `;
56
+ }
57
+ }
58
+ ]);
59
+ try {
60
+ await tasks.run();
61
+ } catch (e) {
62
+ errorTelemetry(process.argv, e.message);
63
+ console.error(c.error(e.message));
64
+ process.exit(e?.exitCode || 1);
65
+ }
66
+ };
67
+ export {
68
+ handler
69
+ };
@@ -0,0 +1,30 @@
1
+ import {
2
+ createCache,
3
+ InMemoryClient,
4
+ MemcachedClient,
5
+ } from '@cedarjs/api/cache'
6
+
7
+ import { logger } from './logger'
8
+
9
+ const memJsFormattedLogger = {
10
+ log: (msg: string) => logger.error(msg),
11
+ }
12
+
13
+ export let client: InMemoryClient | MemcachedClient
14
+
15
+ if (process.env.NODE_ENV === 'test') {
16
+ client = new InMemoryClient()
17
+ } else {
18
+ try {
19
+ client = new MemcachedClient(process.env.CACHE_HOST, {
20
+ logger: memJsFormattedLogger,
21
+ })
22
+ } catch (e) {
23
+ logger.error(`Could not connect to cache: ${e.message}`)
24
+ }
25
+ }
26
+
27
+ export const { cache, cacheFindMany, cacheClient, deleteCacheKey } = createCache(client, {
28
+ logger,
29
+ timeout: 500,
30
+ })
@@ -0,0 +1,24 @@
1
+ import {
2
+ createCache,
3
+ InMemoryClient,
4
+ RedisClient,
5
+ } from '@cedarjs/api/cache'
6
+
7
+ import { logger } from './logger'
8
+
9
+ export let client: InMemoryClient | RedisClient
10
+
11
+ if (process.env.NODE_ENV === 'test') {
12
+ client = new InMemoryClient()
13
+ } else {
14
+ try {
15
+ client = new RedisClient({ url: process.env.CACHE_HOST, logger })
16
+ } catch (e) {
17
+ logger.error(`Could not connect to cache: ${e.message}`)
18
+ }
19
+ }
20
+
21
+ export const { cache, cacheFindMany, cacheClient, deleteCacheKey } = createCache(client, {
22
+ logger,
23
+ timeout: 500,
24
+ })
@@ -0,0 +1,26 @@
1
+ const command = "deploy <target>";
2
+ const description = "Setup deployment to various targets";
3
+ import terminalLink from "terminal-link";
4
+ import * as setupDeployBaremetal from "./providers/baremetal.js";
5
+ import * as setupDeployCoherence from "./providers/coherence.js";
6
+ import * as setupDeployFlightcontrol from "./providers/flightcontrol.js";
7
+ import * as setupDeployNetlify from "./providers/netlify.js";
8
+ import * as setupDeployRender from "./providers/render.js";
9
+ import * as setupDeployServerless from "./providers/serverless.js";
10
+ import * as setupDeployVercel from "./providers/vercel.js";
11
+ const builder = (yargs) => yargs.command(setupDeployBaremetal).command(setupDeployCoherence).command(setupDeployFlightcontrol).command(setupDeployNetlify).command(setupDeployRender).command(setupDeployServerless).command(setupDeployVercel).demandCommand().option("force", {
12
+ alias: "f",
13
+ default: false,
14
+ description: "Overwrite existing configuration",
15
+ type: "boolean"
16
+ }).epilogue(
17
+ `Also see the ${terminalLink(
18
+ "Redwood CLI Reference",
19
+ "https://redwoodjs.com/docs/cli-commands#setup-deploy-config"
20
+ )}`
21
+ );
22
+ export {
23
+ builder,
24
+ command,
25
+ description
26
+ };
@@ -0,0 +1,9 @@
1
+ function createHandler(componentName) {
2
+ return async function handler(argv) {
3
+ const { handler: importedHandler } = await import(`../providers/${componentName}Handler.js`);
4
+ return importedHandler(argv);
5
+ };
6
+ }
7
+ export {
8
+ createHandler
9
+ };
@@ -0,0 +1,110 @@
1
+ import path from "path";
2
+ import execa from "execa";
3
+ import fs from "fs-extra";
4
+ import { Listr } from "listr2";
5
+ import { getPaths, writeFilesTask } from "../../../../lib/index.js";
6
+ const REDWOOD_TOML_PATH = path.join(getPaths().base, "redwood.toml");
7
+ const updateApiURLTask = (apiUrl) => {
8
+ return {
9
+ title: "Updating API URL in redwood.toml...",
10
+ task: () => {
11
+ const redwoodToml = fs.readFileSync(REDWOOD_TOML_PATH).toString();
12
+ let newRedwoodToml = redwoodToml;
13
+ if (redwoodToml.match(/apiUrl/)) {
14
+ newRedwoodToml = newRedwoodToml.replace(
15
+ /apiUrl.*/g,
16
+ `apiUrl = "${apiUrl}"`
17
+ );
18
+ } else if (redwoodToml.match(/\[web\]/)) {
19
+ newRedwoodToml = newRedwoodToml.replace(
20
+ /\[web\]/,
21
+ `[web]
22
+ apiUrl = "${apiUrl}"`
23
+ );
24
+ } else {
25
+ newRedwoodToml += `[web]
26
+ apiUrl = "${apiUrl}"`;
27
+ }
28
+ fs.writeFileSync(REDWOOD_TOML_PATH, newRedwoodToml);
29
+ }
30
+ };
31
+ };
32
+ const preRequisiteCheckTask = (preRequisites) => {
33
+ return {
34
+ title: "Checking pre-requisites",
35
+ task: () => new Listr(
36
+ preRequisites.map((preReq) => {
37
+ return {
38
+ title: preReq.title,
39
+ task: async () => {
40
+ try {
41
+ await execa(...preReq.command);
42
+ } catch (error) {
43
+ error.message = error.message + "\n" + preReq.errorMessage;
44
+ throw error;
45
+ }
46
+ }
47
+ };
48
+ })
49
+ )
50
+ };
51
+ };
52
+ const addFilesTask = ({
53
+ files,
54
+ force = false,
55
+ title = "Adding config"
56
+ }) => {
57
+ return {
58
+ title: `${title}...`,
59
+ task: () => {
60
+ let fileNameToContentMap = {};
61
+ files.forEach((fileData) => {
62
+ fileNameToContentMap[fileData.path] = fileData.content;
63
+ });
64
+ return writeFilesTask(fileNameToContentMap, { overwriteExisting: force });
65
+ }
66
+ };
67
+ };
68
+ const addToGitIgnoreTask = ({ paths }) => {
69
+ return {
70
+ title: "Updating .gitignore...",
71
+ skip: () => {
72
+ if (!fs.existsSync(path.resolve(getPaths().base, ".gitignore"))) {
73
+ return "No gitignore present, skipping.";
74
+ }
75
+ },
76
+ task: async (_ctx, task) => {
77
+ const gitIgnore = path.resolve(getPaths().base, ".gitignore");
78
+ const content = fs.readFileSync(gitIgnore).toString();
79
+ if (paths.every((item) => content.includes(item))) {
80
+ task.skip(".gitignore already includes the additions.");
81
+ }
82
+ fs.appendFileSync(gitIgnore, ["\n", "# Deployment", ...paths].join("\n"));
83
+ }
84
+ };
85
+ };
86
+ const addToDotEnvTask = ({ lines }) => {
87
+ return {
88
+ title: "Updating .env...",
89
+ skip: () => {
90
+ if (!fs.existsSync(path.resolve(getPaths().base, ".env"))) {
91
+ return "No .env present, skipping.";
92
+ }
93
+ },
94
+ task: async (_ctx, task) => {
95
+ const env = path.resolve(getPaths().base, ".env");
96
+ const content = fs.readFileSync(env).toString();
97
+ if (lines.every((line) => content.includes(line.split("=")[0]))) {
98
+ task.skip(".env already includes the additions.");
99
+ }
100
+ fs.appendFileSync(env, lines.join("\n"));
101
+ }
102
+ };
103
+ };
104
+ export {
105
+ addFilesTask,
106
+ addToDotEnvTask,
107
+ addToGitIgnoreTask,
108
+ preRequisiteCheckTask,
109
+ updateApiURLTask
110
+ };
@@ -0,0 +1,9 @@
1
+ import { createHandler } from "../helpers/helpers.js";
2
+ const command = "baremetal";
3
+ const description = "Setup Baremetal deploy";
4
+ const handler = createHandler("baremetal");
5
+ export {
6
+ command,
7
+ description,
8
+ handler
9
+ };
@@ -0,0 +1,64 @@
1
+ import path from "path";
2
+ import { Listr } from "listr2";
3
+ import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
4
+ import { errorTelemetry } from "@cedarjs/telemetry";
5
+ import c from "../../../../lib/colors.js";
6
+ import {
7
+ addPackagesTask,
8
+ getPaths,
9
+ printSetupNotes
10
+ } from "../../../../lib/index.js";
11
+ import { addFilesTask } from "../helpers/index.js";
12
+ import { DEPLOY, ECOSYSTEM, MAINTENANCE } from "../templates/baremetal.js";
13
+ const configFilename = "deploy.toml";
14
+ const files = [
15
+ {
16
+ path: path.join(getPaths().base, configFilename),
17
+ content: DEPLOY
18
+ },
19
+ {
20
+ path: path.join(getPaths().base, "ecosystem.config.js"),
21
+ content: ECOSYSTEM
22
+ },
23
+ {
24
+ path: path.join(getPaths().web.src, "maintenance.html"),
25
+ content: MAINTENANCE
26
+ }
27
+ ];
28
+ const notes = [
29
+ "You are almost ready to go BAREMETAL!",
30
+ "",
31
+ "See https://redwoodjs.com/docs/deploy/baremetal for the remaining",
32
+ "config and setup required before you can perform your first deploy."
33
+ ];
34
+ const handler = async ({ force }) => {
35
+ recordTelemetryAttributes({
36
+ command: "setup deploy baremetal",
37
+ force
38
+ });
39
+ const tasks = new Listr(
40
+ [
41
+ await addPackagesTask({
42
+ packages: ["node-ssh"],
43
+ devDependency: true
44
+ }),
45
+ addFilesTask({
46
+ files,
47
+ force
48
+ }),
49
+ printSetupNotes(notes)
50
+ ],
51
+ { rendererOptions: { collapseSubtasks: false } }
52
+ );
53
+ try {
54
+ await tasks.run();
55
+ } catch (e) {
56
+ errorTelemetry(process.argv, e.message);
57
+ console.error(c.error(e.message));
58
+ process.exit(e?.exitCode || 1);
59
+ }
60
+ };
61
+ export {
62
+ configFilename,
63
+ handler
64
+ };
@@ -0,0 +1,24 @@
1
+ import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
2
+ const command = "coherence";
3
+ const description = "Setup Coherence deploy";
4
+ function builder(yargs) {
5
+ yargs.option("force", {
6
+ description: "Overwrite existing configuration",
7
+ type: "boolean",
8
+ default: false
9
+ });
10
+ }
11
+ async function handler(options) {
12
+ recordTelemetryAttributes({
13
+ command: "setup deploy coherence",
14
+ force: options.force
15
+ });
16
+ const { handler: handler2 } = await import("./coherenceHandler.js");
17
+ return handler2(options);
18
+ }
19
+ export {
20
+ builder,
21
+ command,
22
+ description,
23
+ handler
24
+ };
@@ -0,0 +1,203 @@
1
+ import path from "path";
2
+ import prismaInternals from "@prisma/internals";
3
+ import fs from "fs-extra";
4
+ import { Listr } from "listr2";
5
+ import * as toml from "smol-toml";
6
+ import {
7
+ colors as c,
8
+ getPaths,
9
+ isTypeScriptProject
10
+ } from "@cedarjs/cli-helpers";
11
+ import { errorTelemetry } from "@cedarjs/telemetry";
12
+ import { printSetupNotes } from "../../../../lib/index.js";
13
+ import { serverFileExists } from "../../../../lib/project.js";
14
+ import { addFilesTask } from "../helpers/index.js";
15
+ const { getSchema, getConfig } = prismaInternals;
16
+ const redwoodProjectPaths = getPaths();
17
+ const EXTENSION = isTypeScriptProject ? "ts" : "js";
18
+ async function handler({ force }) {
19
+ try {
20
+ const addCoherenceFilesTask = await getAddCoherenceFilesTask(force);
21
+ const tasks = new Listr(
22
+ [
23
+ addCoherenceFilesTask,
24
+ updateRedwoodTOMLTask(),
25
+ printSetupNotes([
26
+ "You're ready to deploy to Coherence! \u2728\n",
27
+ "Go to https://app.withcoherence.com to create your account and setup your cloud or GitHub connections.",
28
+ "Check out the deployment docs at https://docs.withcoherence.com for detailed instructions and more information.\n",
29
+ "Reach out to redwood@withcoherence.com with any questions! We're here to support you."
30
+ ])
31
+ ],
32
+ { rendererOptions: { collapse: false } }
33
+ );
34
+ await tasks.run();
35
+ } catch (e) {
36
+ errorTelemetry(process.argv, e.message);
37
+ console.error(c.error(e.message));
38
+ process.exit(e?.exitCode || 1);
39
+ }
40
+ }
41
+ async function getAddCoherenceFilesTask(force) {
42
+ const files = [
43
+ {
44
+ path: path.join(redwoodProjectPaths.api.functions, `health.${EXTENSION}`),
45
+ content: coherenceFiles.healthCheck
46
+ }
47
+ ];
48
+ const coherenceConfigFile = {
49
+ path: path.join(redwoodProjectPaths.base, "coherence.yml")
50
+ };
51
+ coherenceConfigFile.content = await getCoherenceConfigFileContent();
52
+ files.push(coherenceConfigFile);
53
+ return addFilesTask({
54
+ title: `Adding coherence.yml and health.${EXTENSION}`,
55
+ files,
56
+ force
57
+ });
58
+ }
59
+ async function getCoherenceConfigFileContent() {
60
+ const prismaSchema = await getSchema(redwoodProjectPaths.api.dbSchema);
61
+ const prismaConfig = await getConfig({ datamodel: prismaSchema });
62
+ let db = prismaConfig.datasources[0].activeProvider;
63
+ if (!SUPPORTED_DATABASES.includes(db)) {
64
+ throw new Error(
65
+ [
66
+ `Coherence doesn't support the "${db}" provider in your Prisma schema.`,
67
+ `To proceed, switch to one of the following: ${SUPPORTED_DATABASES.join(
68
+ ", "
69
+ )}.`
70
+ ].join("\n")
71
+ );
72
+ }
73
+ if (db === "postgresql") {
74
+ db = "postgres";
75
+ }
76
+ const apiProdCommand = ["yarn", "rw", "build", "api", "&&"];
77
+ if (serverFileExists()) {
78
+ apiProdCommand.push(
79
+ "yarn",
80
+ "node",
81
+ "api/dist/server.js",
82
+ "--apiRootPath=/api"
83
+ );
84
+ } else {
85
+ apiProdCommand.push("yarn", "rw", "serve", "api", "--apiRootPath=/api");
86
+ }
87
+ return coherenceFiles.yamlTemplate({
88
+ db,
89
+ apiProdCommand: `[${apiProdCommand.map((cmd) => `"${cmd}"`).join(", ")}]`
90
+ });
91
+ }
92
+ const SUPPORTED_DATABASES = ["mysql", "postgresql"];
93
+ function updateRedwoodTOMLTask() {
94
+ return {
95
+ title: "Updating redwood.toml...",
96
+ task: () => {
97
+ const redwoodTOMLPath = path.join(
98
+ redwoodProjectPaths.base,
99
+ "redwood.toml"
100
+ );
101
+ let redwoodTOMLContent = fs.readFileSync(redwoodTOMLPath, "utf-8");
102
+ const redwoodTOMLObject = toml.parse(redwoodTOMLContent);
103
+ if (!redwoodTOMLObject.web.host) {
104
+ const [beforeWeb, afterWeb] = redwoodTOMLContent.split(/\[web\]\s/);
105
+ redwoodTOMLContent = [
106
+ beforeWeb,
107
+ '[web]\n host = "0.0.0.0"\n',
108
+ afterWeb
109
+ ].join("");
110
+ }
111
+ if (!redwoodTOMLObject.api.host) {
112
+ const [beforeApi, afterApi] = redwoodTOMLContent.split(/\[api\]\s/);
113
+ redwoodTOMLContent = [
114
+ beforeApi,
115
+ '[api]\n host = "0.0.0.0"\n',
116
+ afterApi
117
+ ].join("");
118
+ }
119
+ redwoodTOMLContent = redwoodTOMLContent.replaceAll(
120
+ HOST_REGEXP,
121
+ (match, spaceBeforeAssign, spaceAfterAssign) => ["host", spaceBeforeAssign, "=", spaceAfterAssign, '"0.0.0.0"'].join(
122
+ ""
123
+ )
124
+ );
125
+ redwoodTOMLContent = redwoodTOMLContent.replace(
126
+ API_URL_REGEXP,
127
+ (match, spaceBeforeAssign, spaceAfterAssign) => ["apiUrl", spaceBeforeAssign, "=", spaceAfterAssign, '"/api"'].join(
128
+ ""
129
+ )
130
+ );
131
+ redwoodTOMLContent = redwoodTOMLContent.replaceAll(
132
+ PORT_REGEXP,
133
+ (_match, spaceBeforeAssign, spaceAfterAssign, port) => [
134
+ "port",
135
+ spaceBeforeAssign,
136
+ "=",
137
+ spaceAfterAssign,
138
+ `"\${PORT:${port}}"`
139
+ ].join("")
140
+ );
141
+ fs.writeFileSync(redwoodTOMLPath, redwoodTOMLContent);
142
+ }
143
+ };
144
+ }
145
+ const HOST_REGEXP = /host(\s*)=(\s*)\".+\"/g;
146
+ const API_URL_REGEXP = /apiUrl(\s*)=(\s*)\".+\"/;
147
+ const PORT_REGEXP = /port(\s*)=(\s*)(?<port>\d{4})/g;
148
+ const coherenceFiles = {
149
+ yamlTemplate({ db, apiProdCommand }) {
150
+ return `api:
151
+ type: backend
152
+ url_path: "/api"
153
+ prod:
154
+ command: ${apiProdCommand}
155
+ dev:
156
+ command: ["yarn", "rw", "build", "api", "&&", "yarn", "rw", "dev", "api", "--apiRootPath=/api"]
157
+ local_packages: ["node_modules"]
158
+
159
+ system:
160
+ cpu: 2
161
+ memory: 2G
162
+ health_check: "/api/health"
163
+
164
+ resources:
165
+ - name: ${path.basename(redwoodProjectPaths.base)}-db
166
+ engine: ${db}
167
+ version: 13
168
+ type: database
169
+ ${db === "postgres" ? "adapter: postgresql" : ""}
170
+
171
+ # If you use data migrations, use the following instead:
172
+ # migration: ["yarn", "rw", "prisma", "migrate", "deploy", "&&", "yarn", "rw", "data-migrate", "up"]
173
+ migration: ["yarn", "rw", "prisma", "migrate", "deploy"]
174
+
175
+ web:
176
+ type: frontend
177
+ assets_path: "web/dist"
178
+ prod:
179
+ command: ["yarn", "rw", "serve", "web"]
180
+ dev:
181
+ command: ["yarn", "rw", "dev", "web", "--fwd=\\"--allowed-hosts all\\""]
182
+
183
+ # Heads up: Redwood's prerender doesn't work with Coherence yet.
184
+ # For current status and updates, see https://github.com/redwoodjs/redwood/issues/8333.
185
+ build: ["yarn", "rw", "build", "web", "--no-prerender"]
186
+ local_packages: ["node_modules"]
187
+
188
+ system:
189
+ cpu: 2
190
+ memory: 2G
191
+ `;
192
+ },
193
+ healthCheck: `// Coherence health check
194
+ export const handler = async () => {
195
+ return {
196
+ statusCode: 200,
197
+ }
198
+ }
199
+ `
200
+ };
201
+ export {
202
+ handler
203
+ };
@@ -0,0 +1,19 @@
1
+ import { createHandler } from "../helpers/helpers.js";
2
+ const command = "flightcontrol";
3
+ const alias = "fc";
4
+ const description = "Setup Flightcontrol deploy";
5
+ const builder = (yargs) => yargs.option("database", {
6
+ alias: "d",
7
+ choices: ["none", "postgresql", "mysql"],
8
+ description: "Database deployment for Flightcontrol only",
9
+ default: "postgresql",
10
+ type: "string"
11
+ });
12
+ const handler = createHandler("flightcontrol");
13
+ export {
14
+ alias,
15
+ builder,
16
+ command,
17
+ description,
18
+ handler
19
+ };