@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.
- package/LICENSE +21 -0
- package/README.md +706 -0
- package/dist/commands/build.js +54 -0
- package/dist/commands/buildHandler.js +134 -0
- package/dist/commands/check.js +28 -0
- package/dist/commands/console.js +13 -0
- package/dist/commands/consoleHandler.js +68 -0
- package/dist/commands/deploy/baremetal/SshExecutor.js +41 -0
- package/dist/commands/deploy/baremetal/baremetalHandler.js +558 -0
- package/dist/commands/deploy/baremetal.js +89 -0
- package/dist/commands/deploy/flightcontrol.js +40 -0
- package/dist/commands/deploy/flightcontrolHandler.js +58 -0
- package/dist/commands/deploy/helpers/deployBuilder.js +25 -0
- package/dist/commands/deploy/helpers/deployHandler.js +31 -0
- package/dist/commands/deploy/netlify.js +21 -0
- package/dist/commands/deploy/packing/nft.js +61 -0
- package/dist/commands/deploy/render.js +37 -0
- package/dist/commands/deploy/renderHandler.js +70 -0
- package/dist/commands/deploy/serverless.js +51 -0
- package/dist/commands/deploy/serverlessHandler.js +211 -0
- package/dist/commands/deploy/vercel.js +21 -0
- package/dist/commands/deploy.js +21 -0
- package/dist/commands/destroy/cell/cell.js +12 -0
- package/dist/commands/destroy/cell/cellHandler.js +10 -0
- package/dist/commands/destroy/component/component.js +15 -0
- package/dist/commands/destroy/component/componentHandler.js +10 -0
- package/dist/commands/destroy/directive/directive.js +14 -0
- package/dist/commands/destroy/directive/directiveHandler.js +12 -0
- package/dist/commands/destroy/function/function.js +20 -0
- package/dist/commands/destroy/function/functionHandler.js +10 -0
- package/dist/commands/destroy/handlerHelpers.js +34 -0
- package/dist/commands/destroy/helpers.js +22 -0
- package/dist/commands/destroy/layout/layout.js +12 -0
- package/dist/commands/destroy/layout/layoutHandler.js +10 -0
- package/dist/commands/destroy/page/page.js +20 -0
- package/dist/commands/destroy/page/pageHandler.js +51 -0
- package/dist/commands/destroy/scaffold/scaffold.js +16 -0
- package/dist/commands/destroy/scaffold/scaffoldHandler.js +105 -0
- package/dist/commands/destroy/sdl/sdl.js +16 -0
- package/dist/commands/destroy/sdl/sdlHandler.js +33 -0
- package/dist/commands/destroy/service/service.js +10 -0
- package/dist/commands/destroy/service/serviceHandler.js +17 -0
- package/dist/commands/destroy.js +25 -0
- package/dist/commands/dev.js +47 -0
- package/dist/commands/devHandler.js +202 -0
- package/dist/commands/exec.js +38 -0
- package/dist/commands/execHandler.js +180 -0
- package/dist/commands/experimental/setupInngest.js +28 -0
- package/dist/commands/experimental/setupInngestHandler.js +46 -0
- package/dist/commands/experimental/setupOpentelemetry.js +34 -0
- package/dist/commands/experimental/setupOpentelemetryHandler.js +215 -0
- package/dist/commands/experimental/setupReactCompiler.js +28 -0
- package/dist/commands/experimental/setupReactCompilerHandler.js +124 -0
- package/dist/commands/experimental/setupRsc.js +28 -0
- package/dist/commands/experimental/setupRscHandler.js +408 -0
- package/dist/commands/experimental/setupStreamingSsr.js +28 -0
- package/dist/commands/experimental/setupStreamingSsrHandler.js +208 -0
- package/dist/commands/experimental/templates/opentelemetry.ts.template +55 -0
- package/dist/commands/experimental/templates/rsc/AboutCounter.tsx.template +20 -0
- package/dist/commands/experimental/templates/rsc/AboutPage.css.template +2 -0
- package/dist/commands/experimental/templates/rsc/AboutPage.tsx.template +17 -0
- package/dist/commands/experimental/templates/rsc/Counter.css.template +7 -0
- package/dist/commands/experimental/templates/rsc/Counter.module.css.template +3 -0
- package/dist/commands/experimental/templates/rsc/Counter.tsx.template +18 -0
- package/dist/commands/experimental/templates/rsc/Document.tsx.template +27 -0
- package/dist/commands/experimental/templates/rsc/HomePage.css.template +2 -0
- package/dist/commands/experimental/templates/rsc/HomePage.module.css.template +3 -0
- package/dist/commands/experimental/templates/rsc/HomePage.tsx.template +19 -0
- package/dist/commands/experimental/templates/rsc/NavigationLayout.css.template +32 -0
- package/dist/commands/experimental/templates/rsc/NavigationLayout.tsx.template +31 -0
- package/dist/commands/experimental/templates/rsc/Routes.tsx.template +29 -0
- package/dist/commands/experimental/templates/rsc/entry.client.tsx.template +35 -0
- package/dist/commands/experimental/templates/rsc/entry.server.tsx.template +20 -0
- package/dist/commands/experimental/templates/rsc/index.css.template +4 -0
- package/dist/commands/experimental/templates/streamingSsr/Document.tsx.template +27 -0
- package/dist/commands/experimental/templates/streamingSsr/entry.client.tsx.template +40 -0
- package/dist/commands/experimental/templates/streamingSsr/entry.server.tsx.template +20 -0
- package/dist/commands/experimental/templates/streamingSsr/tsconfig.json.template +54 -0
- package/dist/commands/experimental/util.js +69 -0
- package/dist/commands/experimental.js +22 -0
- package/dist/commands/generate/cell/cell.js +35 -0
- package/dist/commands/generate/cell/cellHandler.js +153 -0
- package/dist/commands/generate/cell/templates/cell.tsx.template +34 -0
- package/dist/commands/generate/cell/templates/cellList.tsx.template +40 -0
- package/dist/commands/generate/cell/templates/mock.ts.template +7 -0
- package/dist/commands/generate/cell/templates/mockList.ts.template +14 -0
- package/dist/commands/generate/cell/templates/stories.tsx.template +35 -0
- package/dist/commands/generate/cell/templates/test.js.template +42 -0
- package/dist/commands/generate/cell/utils/utils.js +43 -0
- package/dist/commands/generate/component/component.js +15 -0
- package/dist/commands/generate/component/componentHandler.js +55 -0
- package/dist/commands/generate/component/templates/component.tsx.template +10 -0
- package/dist/commands/generate/component/templates/stories.jsx.template +17 -0
- package/dist/commands/generate/component/templates/stories.tsx.template +26 -0
- package/dist/commands/generate/component/templates/test.tsx.template +14 -0
- package/dist/commands/generate/dataMigration/dataMigration.js +105 -0
- package/dist/commands/generate/dataMigration/templates/dataMigration.js.template +7 -0
- package/dist/commands/generate/dataMigration/templates/dataMigration.ts.template +5 -0
- package/dist/commands/generate/dbAuth/dbAuth.js +55 -0
- package/dist/commands/generate/dbAuth/dbAuthHandler.js +375 -0
- package/dist/commands/generate/dbAuth/templates/forgotPassword.tsx.template +94 -0
- package/dist/commands/generate/dbAuth/templates/login.tsx.template +130 -0
- package/dist/commands/generate/dbAuth/templates/login.webAuthn.tsx.template +264 -0
- package/dist/commands/generate/dbAuth/templates/resetPassword.tsx.template +121 -0
- package/dist/commands/generate/dbAuth/templates/signup.tsx.template +123 -0
- package/dist/commands/generate/directive/directive.js +15 -0
- package/dist/commands/generate/directive/directiveHandler.js +159 -0
- package/dist/commands/generate/directive/templates/transformer.directive.test.ts.template +18 -0
- package/dist/commands/generate/directive/templates/transformer.directive.ts.template +38 -0
- package/dist/commands/generate/directive/templates/validator.directive.test.ts.template +17 -0
- package/dist/commands/generate/directive/templates/validator.directive.ts.template +39 -0
- package/dist/commands/generate/function/function.js +29 -0
- package/dist/commands/generate/function/functionHandler.js +131 -0
- package/dist/commands/generate/function/templates/function.ts.template +33 -0
- package/dist/commands/generate/function/templates/scenarios.ts.template +8 -0
- package/dist/commands/generate/function/templates/test.ts.template +30 -0
- package/dist/commands/generate/helpers.js +71 -0
- package/dist/commands/generate/job/job.js +39 -0
- package/dist/commands/generate/job/jobHandler.js +138 -0
- package/dist/commands/generate/job/templates/job.ts.template +8 -0
- package/dist/commands/generate/job/templates/scenarios.ts.template +8 -0
- package/dist/commands/generate/job/templates/test.ts.template +7 -0
- package/dist/commands/generate/layout/layout.js +25 -0
- package/dist/commands/generate/layout/layoutHandler.js +59 -0
- package/dist/commands/generate/layout/templates/layout.tsx.a11y.template +27 -0
- package/dist/commands/generate/layout/templates/layout.tsx.template +9 -0
- package/dist/commands/generate/layout/templates/stories.tsx.template +13 -0
- package/dist/commands/generate/layout/templates/test.tsx.template +14 -0
- package/dist/commands/generate/model/model.js +29 -0
- package/dist/commands/generate/model/modelHandler.js +63 -0
- package/dist/commands/generate/model/templates/model.js.template +3 -0
- package/dist/commands/generate/ogImage/ogImage.js +43 -0
- package/dist/commands/generate/ogImage/ogImageHandler.js +111 -0
- package/dist/commands/generate/ogImage/templates/ogImage.og.tsx.template +13 -0
- package/dist/commands/generate/page/page.js +22 -0
- package/dist/commands/generate/page/pageHandler.js +227 -0
- package/dist/commands/generate/page/templates/page.tsx.template +35 -0
- package/dist/commands/generate/page/templates/stories.tsx.parameters.template +13 -0
- package/dist/commands/generate/page/templates/stories.tsx.template +13 -0
- package/dist/commands/generate/page/templates/test.tsx.template +14 -0
- package/dist/commands/generate/realtime/realtime.js +41 -0
- package/dist/commands/generate/realtime/realtimeHandler.js +215 -0
- package/dist/commands/generate/realtime/templates/liveQueries/blank/blank.sdl.ts.template +27 -0
- package/dist/commands/generate/realtime/templates/liveQueries/blank/blank.service.ts.template +73 -0
- package/dist/commands/generate/realtime/templates/realtime.ts.template +42 -0
- package/dist/commands/generate/realtime/templates/subscriptions/blank/blank.sdl.ts.template +20 -0
- package/dist/commands/generate/realtime/templates/subscriptions/blank/blank.service.ts.template +19 -0
- package/dist/commands/generate/realtime/templates/subscriptions/blank/blank.ts.template +58 -0
- package/dist/commands/generate/scaffold/scaffold.js +38 -0
- package/dist/commands/generate/scaffold/scaffoldHandler.js +663 -0
- package/dist/commands/generate/scaffold/templates/assets/scaffold.css.template +398 -0
- package/dist/commands/generate/scaffold/templates/assets/scaffold.tailwind.css.template +243 -0
- package/dist/commands/generate/scaffold/templates/components/EditNameCell.tsx.template +74 -0
- package/dist/commands/generate/scaffold/templates/components/Name.tsx.template +79 -0
- package/dist/commands/generate/scaffold/templates/components/NameCell.tsx.template +32 -0
- package/dist/commands/generate/scaffold/templates/components/NameForm.tsx.template +123 -0
- package/dist/commands/generate/scaffold/templates/components/Names.tsx.template +88 -0
- package/dist/commands/generate/scaffold/templates/components/NamesCell.tsx.template +45 -0
- package/dist/commands/generate/scaffold/templates/components/NewName.tsx.template +55 -0
- package/dist/commands/generate/scaffold/templates/layouts/ScaffoldLayout.tsx.template +37 -0
- package/dist/commands/generate/scaffold/templates/lib/formatters.test.tsx.template +192 -0
- package/dist/commands/generate/scaffold/templates/lib/formatters.tsx.template +58 -0
- package/dist/commands/generate/scaffold/templates/pages/EditNamePage.tsx.template +11 -0
- package/dist/commands/generate/scaffold/templates/pages/NamePage.tsx.template +11 -0
- package/dist/commands/generate/scaffold/templates/pages/NamesPage.tsx.template +7 -0
- package/dist/commands/generate/scaffold/templates/pages/NewNamePage.tsx.template +7 -0
- package/dist/commands/generate/script/script.js +29 -0
- package/dist/commands/generate/script/scriptHandler.js +85 -0
- package/dist/commands/generate/script/templates/script.ts.template +15 -0
- package/dist/commands/generate/script/templates/tsconfig.json.template +33 -0
- package/dist/commands/generate/sdl/sdl.js +48 -0
- package/dist/commands/generate/sdl/sdlHandler.js +282 -0
- package/dist/commands/generate/sdl/templates/sdl.js.template +70 -0
- package/dist/commands/generate/sdl/templates/sdl.ts.template +70 -0
- package/dist/commands/generate/secret/secret.js +52 -0
- package/dist/commands/generate/service/service.js +50 -0
- package/dist/commands/generate/service/serviceHandler.js +301 -0
- package/dist/commands/generate/service/templates/scenarios.ts.template +7 -0
- package/dist/commands/generate/service/templates/service.ts.template +38 -0
- package/dist/commands/generate/service/templates/test.ts.template +84 -0
- package/dist/commands/generate/yargsCommandHelpers.js +77 -0
- package/dist/commands/generate/yargsHandlerHelpers.js +155 -0
- package/dist/commands/generate.js +44 -0
- package/dist/commands/info.js +36 -0
- package/dist/commands/jobs.js +17 -0
- package/dist/commands/jobsHandler.js +30 -0
- package/dist/commands/lint.js +57 -0
- package/dist/commands/prerender.js +34 -0
- package/dist/commands/prerenderHandler.js +282 -0
- package/dist/commands/prisma.js +17 -0
- package/dist/commands/prismaHandler.js +90 -0
- package/dist/commands/record/init.js +11 -0
- package/dist/commands/record.js +19 -0
- package/dist/commands/serve.js +139 -0
- package/dist/commands/serveApiHandler.js +15 -0
- package/dist/commands/serveBothHandler.js +95 -0
- package/dist/commands/serveWebHandler.js +17 -0
- package/dist/commands/setup/auth/auth.js +265 -0
- package/dist/commands/setup/cache/cache.js +37 -0
- package/dist/commands/setup/cache/cacheHandler.js +69 -0
- package/dist/commands/setup/cache/templates/memcached.ts.template +30 -0
- package/dist/commands/setup/cache/templates/redis.ts.template +24 -0
- package/dist/commands/setup/deploy/deploy.js +26 -0
- package/dist/commands/setup/deploy/helpers/helpers.js +9 -0
- package/dist/commands/setup/deploy/helpers/index.js +110 -0
- package/dist/commands/setup/deploy/providers/baremetal.js +9 -0
- package/dist/commands/setup/deploy/providers/baremetalHandler.js +64 -0
- package/dist/commands/setup/deploy/providers/coherence.js +24 -0
- package/dist/commands/setup/deploy/providers/coherenceHandler.js +203 -0
- package/dist/commands/setup/deploy/providers/flightcontrol.js +19 -0
- package/dist/commands/setup/deploy/providers/flightcontrolHandler.js +294 -0
- package/dist/commands/setup/deploy/providers/netlify.js +9 -0
- package/dist/commands/setup/deploy/providers/netlifyHandler.js +42 -0
- package/dist/commands/setup/deploy/providers/render.js +17 -0
- package/dist/commands/setup/deploy/providers/renderHandler.js +111 -0
- package/dist/commands/setup/deploy/providers/serverless.js +11 -0
- package/dist/commands/setup/deploy/providers/serverlessHandler.js +141 -0
- package/dist/commands/setup/deploy/providers/vercel.js +9 -0
- package/dist/commands/setup/deploy/providers/vercelHandler.js +56 -0
- package/dist/commands/setup/deploy/templates/baremetal.js +128 -0
- package/dist/commands/setup/deploy/templates/flightcontrol.js +85 -0
- package/dist/commands/setup/deploy/templates/netlify.js +32 -0
- package/dist/commands/setup/deploy/templates/render.js +72 -0
- package/dist/commands/setup/deploy/templates/serverless/api.js +78 -0
- package/dist/commands/setup/deploy/templates/serverless/web.js +32 -0
- package/dist/commands/setup/docker/docker.js +26 -0
- package/dist/commands/setup/docker/dockerHandler.js +265 -0
- package/dist/commands/setup/docker/templates/Dockerfile +154 -0
- package/dist/commands/setup/docker/templates/docker-compose.dev.yml +58 -0
- package/dist/commands/setup/docker/templates/docker-compose.prod.yml +63 -0
- package/dist/commands/setup/docker/templates/dockerignore +18 -0
- package/dist/commands/setup/generator/generator.js +49 -0
- package/dist/commands/setup/generator/generatorHandler.js +55 -0
- package/dist/commands/setup/graphql/features/fragments/appGqlConfigTransform.js +117 -0
- package/dist/commands/setup/graphql/features/fragments/appImportTransform.js +20 -0
- package/dist/commands/setup/graphql/features/fragments/fragments.js +25 -0
- package/dist/commands/setup/graphql/features/fragments/fragmentsHandler.js +89 -0
- package/dist/commands/setup/graphql/features/trustedDocuments/graphqlTransform.js +51 -0
- package/dist/commands/setup/graphql/features/trustedDocuments/trustedDocuments.js +25 -0
- package/dist/commands/setup/graphql/features/trustedDocuments/trustedDocumentsHandler.js +74 -0
- package/dist/commands/setup/graphql/graphql.js +18 -0
- package/dist/commands/setup/i18n/i18n.js +25 -0
- package/dist/commands/setup/i18n/i18nHandler.js +169 -0
- package/dist/commands/setup/i18n/templates/en.json.template +11 -0
- package/dist/commands/setup/i18n/templates/fr.json.template +11 -0
- package/dist/commands/setup/i18n/templates/i18n.js.template +52 -0
- package/dist/commands/setup/i18n/templates/storybook.preview.tsx.template +43 -0
- package/dist/commands/setup/jobs/jobs.js +31 -0
- package/dist/commands/setup/jobs/jobsHandler.js +122 -0
- package/dist/commands/setup/jobs/templates/jobs.ts.template +32 -0
- package/dist/commands/setup/mailer/mailer.js +30 -0
- package/dist/commands/setup/mailer/mailerHandler.js +106 -0
- package/dist/commands/setup/mailer/templates/mailer.ts.template +30 -0
- package/dist/commands/setup/mailer/templates/re-example.tsx.template +40 -0
- package/dist/commands/setup/middleware/middleware.js +17 -0
- package/dist/commands/setup/middleware/ogImage/__codemod_tests__/middleware.js +15 -0
- package/dist/commands/setup/middleware/ogImage/__codemod_tests__/vitePlugin.js +6 -0
- package/dist/commands/setup/middleware/ogImage/codemodMiddleware.js +97 -0
- package/dist/commands/setup/middleware/ogImage/codemodVitePlugin.js +65 -0
- package/dist/commands/setup/middleware/ogImage/ogImage.js +27 -0
- package/dist/commands/setup/middleware/ogImage/ogImageHandler.js +121 -0
- package/dist/commands/setup/monitoring/monitoring.js +17 -0
- package/dist/commands/setup/monitoring/sentry/sentry.js +25 -0
- package/dist/commands/setup/monitoring/sentry/sentryHandler.js +163 -0
- package/dist/commands/setup/monitoring/sentry/templates/sentryApi.ts.template +15 -0
- package/dist/commands/setup/monitoring/sentry/templates/sentryWeb.ts.template +31 -0
- package/dist/commands/setup/package/package.js +33 -0
- package/dist/commands/setup/package/packageHandler.js +134 -0
- package/dist/commands/setup/realtime/realtime.js +37 -0
- package/dist/commands/setup/realtime/realtimeHandler.js +309 -0
- package/dist/commands/setup/realtime/templates/defer/fastAndSlowFields/fastAndSlowFields.sdl.template +14 -0
- package/dist/commands/setup/realtime/templates/defer/fastAndSlowFields/fastAndSlowFields.ts.template +14 -0
- package/dist/commands/setup/realtime/templates/liveQueries/auctions/auctions.sdl.ts.template +27 -0
- package/dist/commands/setup/realtime/templates/liveQueries/auctions/auctions.ts.template +73 -0
- package/dist/commands/setup/realtime/templates/realtime.ts.template +46 -0
- package/dist/commands/setup/realtime/templates/stream/alphabet/alphabet.sdl.template +9 -0
- package/dist/commands/setup/realtime/templates/stream/alphabet/alphabet.ts.template +31 -0
- package/dist/commands/setup/realtime/templates/subscriptions/countdown/countdown.ts.template +58 -0
- package/dist/commands/setup/realtime/templates/subscriptions/newMessage/newMessage.ts.template +57 -0
- package/dist/commands/setup/realtime/templates/subscriptions/newMessage/rooms.sdl.ts.template +20 -0
- package/dist/commands/setup/realtime/templates/subscriptions/newMessage/rooms.ts.template +20 -0
- package/dist/commands/setup/server-file/serverFile.js +31 -0
- package/dist/commands/setup/server-file/serverFileHandler.js +56 -0
- package/dist/commands/setup/server-file/templates/server.ts.template +13 -0
- package/dist/commands/setup/tsconfig/tsconfig.js +25 -0
- package/dist/commands/setup/tsconfig/tsconfigHandler.js +59 -0
- package/dist/commands/setup/ui/helpers/helpers.js +9 -0
- package/dist/commands/setup/ui/libraries/chakra-ui.js +24 -0
- package/dist/commands/setup/ui/libraries/chakra-uiHandler.js +98 -0
- package/dist/commands/setup/ui/libraries/mantine.js +32 -0
- package/dist/commands/setup/ui/libraries/mantineHandler.js +138 -0
- package/dist/commands/setup/ui/libraries/tailwindcss.js +26 -0
- package/dist/commands/setup/ui/libraries/tailwindcssHandler.js +386 -0
- package/dist/commands/setup/ui/templates/chakra.storybook.preview.tsx.template +20 -0
- package/dist/commands/setup/ui/templates/mantine-postcss.config.js.template +35 -0
- package/dist/commands/setup/ui/templates/mantine.storybook.preview.tsx.template +18 -0
- package/dist/commands/setup/ui/templates/postcss.config.js.template +9 -0
- package/dist/commands/setup/ui/ui.js +17 -0
- package/dist/commands/setup/uploads/dbCodemod.js +28 -0
- package/dist/commands/setup/uploads/templates/signedUrl.ts.template +21 -0
- package/dist/commands/setup/uploads/templates/srcLibUploads.ts.template +25 -0
- package/dist/commands/setup/uploads/uploads.js +26 -0
- package/dist/commands/setup/uploads/uploadsHandler.js +147 -0
- package/dist/commands/setup/vite/templates/vite.config.ts.template +19 -0
- package/dist/commands/setup/vite/vite.js +38 -0
- package/dist/commands/setup/vite/viteHandler.js +83 -0
- package/dist/commands/setup.js +33 -0
- package/dist/commands/studio.js +23 -0
- package/dist/commands/studioHandler.js +61 -0
- package/dist/commands/test.js +44 -0
- package/dist/commands/testHandler.js +138 -0
- package/dist/commands/ts-to-js.js +20 -0
- package/dist/commands/type-check.js +41 -0
- package/dist/commands/type-checkHandler.js +71 -0
- package/dist/commands/upgrade.js +441 -0
- package/dist/index.d.js +0 -0
- package/dist/index.js +146 -0
- package/dist/lib/background.js +45 -0
- package/dist/lib/colors.js +18 -0
- package/dist/lib/configureStorybook.js +50 -0
- package/dist/lib/exec.js +85 -0
- package/dist/lib/exit.js +44 -0
- package/dist/lib/extendFile.js +114 -0
- package/dist/lib/generatePrismaClient.js +60 -0
- package/dist/lib/index.js +485 -0
- package/dist/lib/loadEnvFiles.js +12 -0
- package/dist/lib/locking.js +60 -0
- package/dist/lib/merge/algorithms.js +30 -0
- package/dist/lib/merge/index.js +163 -0
- package/dist/lib/merge/semanticIdentity.js +18 -0
- package/dist/lib/merge/strategy.js +136 -0
- package/dist/lib/mockTelemetry.js +7 -0
- package/dist/lib/packages.js +77 -0
- package/dist/lib/plugin.js +206 -0
- package/dist/lib/pluralHelpers.js +50 -0
- package/dist/lib/ports.js +17 -0
- package/dist/lib/project.js +30 -0
- package/dist/lib/rollback.js +72 -0
- package/dist/lib/runTransform.js +66 -0
- package/dist/lib/rwPluralize.js +56 -0
- package/dist/lib/schemaHelpers.js +95 -0
- package/dist/lib/templates/storybook.preview.tsx.template +19 -0
- package/dist/lib/test.js +106 -0
- package/dist/lib/updateCheck.js +202 -0
- package/dist/lib/updateCheckExecute.js +2 -0
- package/dist/middleware/checkNodeVersion.js +23 -0
- package/dist/middleware/detectProjectRxVersion.js +12 -0
- package/dist/plugin.js +223 -0
- package/dist/rwfw.js +47 -0
- package/dist/telemetry/exporter.js +63 -0
- package/dist/telemetry/index.js +84 -0
- package/dist/telemetry/resource.js +98 -0
- package/dist/telemetry/send.js +80 -0
- package/dist/testLib/cells.js +188 -0
- package/dist/testLib/fetchFileFromTemplate.js +9 -0
- package/dist/testLib/getFilesWithPattern.js +21 -0
- package/dist/testLib/getRootPackageJSON.js +14 -0
- package/dist/testLib/isTSProject.js +9 -0
- package/dist/testLib/runTransform.js +42 -0
- package/package.json +102 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
const ECOSYSTEM = `module.exports = {
|
|
2
|
+
apps: [
|
|
3
|
+
{
|
|
4
|
+
name: 'serve',
|
|
5
|
+
cwd: 'current',
|
|
6
|
+
script: 'node_modules/.bin/rw',
|
|
7
|
+
args: 'serve',
|
|
8
|
+
instances: 'max',
|
|
9
|
+
exec_mode: 'cluster',
|
|
10
|
+
wait_ready: true,
|
|
11
|
+
listen_timeout: 10000,
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
}`;
|
|
15
|
+
const DEPLOY = `# This file contains config for a baremetal deployment
|
|
16
|
+
#
|
|
17
|
+
# SSH connection options include:
|
|
18
|
+
#
|
|
19
|
+
# * host - the remote server hostname/IP
|
|
20
|
+
# * port - defaults to 22
|
|
21
|
+
# * username - required, the user you're connecting as
|
|
22
|
+
# * password - only set if you're not using key-based authentication
|
|
23
|
+
# * privateKey - a Buffer containing the private key (use this _or_ 'privateKeyPath', not both)
|
|
24
|
+
# * privateKeyPath - local file path to a private key that will be sent with the connection request
|
|
25
|
+
# * passphrase - used if your private key has a passphrase
|
|
26
|
+
# * agentForward - set to \`true\` to forward the client machine's ssh credentials
|
|
27
|
+
#
|
|
28
|
+
# See https://redwoodjs.com/docs/deploy/baremetal for more info
|
|
29
|
+
|
|
30
|
+
[[production.servers]]
|
|
31
|
+
host = "server.com"
|
|
32
|
+
username = "user"
|
|
33
|
+
agentForward = true
|
|
34
|
+
sides = ["api","web"]
|
|
35
|
+
packageManagerCommand = "yarn"
|
|
36
|
+
monitorCommand = "pm2"
|
|
37
|
+
path = "/var/www/app"
|
|
38
|
+
processNames = ["serve"]
|
|
39
|
+
repo = "git@github.com:myorg/myapp.git"
|
|
40
|
+
branch = "main"
|
|
41
|
+
keepReleases = 5
|
|
42
|
+
freeSpaceRequired = 2048
|
|
43
|
+
|
|
44
|
+
# If you have separate api and web servers:
|
|
45
|
+
#
|
|
46
|
+
# [[production.servers]]
|
|
47
|
+
# host = "api.server.com"
|
|
48
|
+
# username = "user"
|
|
49
|
+
# agentForward = true
|
|
50
|
+
# sides = ["api"]
|
|
51
|
+
# path = "/var/www/app"
|
|
52
|
+
# repo = "git@github.com:cedarjs/cedar.git"
|
|
53
|
+
# branch = "main"
|
|
54
|
+
# processNames = ["api"]
|
|
55
|
+
#
|
|
56
|
+
# [[production.servers]]
|
|
57
|
+
# host = "web.server.com"
|
|
58
|
+
# username = "user"
|
|
59
|
+
# agentForward = true
|
|
60
|
+
# sides = ["web"]
|
|
61
|
+
# path = "/var/www/app"
|
|
62
|
+
# repo = "git@github.com:cedarjs/cedar.git"
|
|
63
|
+
# branch = "main"
|
|
64
|
+
# migrate = false # only one server in a cluster needs to migrate
|
|
65
|
+
# processNames = ["web"]
|
|
66
|
+
`;
|
|
67
|
+
const MAINTENANCE = `<!--
|
|
68
|
+
Put up this maintenance page on your deployed service with:
|
|
69
|
+
|
|
70
|
+
yarn rw baremetal deploy --maintenance up
|
|
71
|
+
|
|
72
|
+
And take it back down with:
|
|
73
|
+
|
|
74
|
+
yarn rw baremetal deploy --maintenance down
|
|
75
|
+
-->
|
|
76
|
+
|
|
77
|
+
<!DOCTYPE html>
|
|
78
|
+
<html>
|
|
79
|
+
<head>
|
|
80
|
+
<title>Maintenance</title>
|
|
81
|
+
<style>
|
|
82
|
+
html, body {
|
|
83
|
+
margin: 0;
|
|
84
|
+
}
|
|
85
|
+
html * {
|
|
86
|
+
box-sizing: border-box;
|
|
87
|
+
}
|
|
88
|
+
main {
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
|
|
92
|
+
text-align: center;
|
|
93
|
+
background-color: #E2E8F0;
|
|
94
|
+
height: 100vh;
|
|
95
|
+
}
|
|
96
|
+
section {
|
|
97
|
+
background-color: white;
|
|
98
|
+
border-radius: 0.25rem;
|
|
99
|
+
width: 36rem;
|
|
100
|
+
padding: 1rem;
|
|
101
|
+
margin: 0 auto;
|
|
102
|
+
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
|
|
103
|
+
}
|
|
104
|
+
h1 {
|
|
105
|
+
font-size: 2rem;
|
|
106
|
+
margin: 0;
|
|
107
|
+
font-weight: 500;
|
|
108
|
+
line-height: 1;
|
|
109
|
+
color: #2D3748;
|
|
110
|
+
}
|
|
111
|
+
</style>
|
|
112
|
+
</head>
|
|
113
|
+
<body>
|
|
114
|
+
<main>
|
|
115
|
+
<section>
|
|
116
|
+
<h1>
|
|
117
|
+
<span>Maintenance Mode: Be Back Soon</span>
|
|
118
|
+
</h1>
|
|
119
|
+
</section>
|
|
120
|
+
</main>
|
|
121
|
+
</body>
|
|
122
|
+
</html>
|
|
123
|
+
`;
|
|
124
|
+
export {
|
|
125
|
+
DEPLOY,
|
|
126
|
+
ECOSYSTEM,
|
|
127
|
+
MAINTENANCE
|
|
128
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
const flightcontrolConfig = {
|
|
2
|
+
$schema: "https://app.flightcontrol.dev/schema.json",
|
|
3
|
+
environments: [
|
|
4
|
+
{
|
|
5
|
+
id: "development",
|
|
6
|
+
name: "Development",
|
|
7
|
+
region: "us-east-1",
|
|
8
|
+
source: {
|
|
9
|
+
branch: "main"
|
|
10
|
+
},
|
|
11
|
+
services: [
|
|
12
|
+
{
|
|
13
|
+
id: "redwood-api",
|
|
14
|
+
name: "Redwood API",
|
|
15
|
+
type: "web",
|
|
16
|
+
buildType: "nixpacks",
|
|
17
|
+
cpu: 0.5,
|
|
18
|
+
memory: 1,
|
|
19
|
+
buildCommand: "yarn rw deploy flightcontrol api",
|
|
20
|
+
startCommand: "yarn rw deploy flightcontrol api --serve",
|
|
21
|
+
port: 8911,
|
|
22
|
+
healthCheckPath: "/graphql/health",
|
|
23
|
+
ci: {
|
|
24
|
+
type: "ec2"
|
|
25
|
+
},
|
|
26
|
+
envVariables: {
|
|
27
|
+
REDWOOD_WEB_URL: {
|
|
28
|
+
fromService: { id: "redwood-web", value: "origin" }
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: "redwood-web",
|
|
34
|
+
name: "Redwood Web",
|
|
35
|
+
type: "static",
|
|
36
|
+
buildType: "nixpacks",
|
|
37
|
+
singlePageApp: true,
|
|
38
|
+
buildCommand: "yarn rw deploy flightcontrol web",
|
|
39
|
+
outputDirectory: "web/dist",
|
|
40
|
+
ci: {
|
|
41
|
+
type: "ec2"
|
|
42
|
+
},
|
|
43
|
+
envVariables: {
|
|
44
|
+
REDWOOD_API_URL: {
|
|
45
|
+
fromService: { id: "redwood-api", value: "origin" }
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
};
|
|
53
|
+
const postgresDatabaseService = {
|
|
54
|
+
id: "db",
|
|
55
|
+
name: "Database",
|
|
56
|
+
type: "rds",
|
|
57
|
+
engine: "postgres",
|
|
58
|
+
engineVersion: "16",
|
|
59
|
+
instanceSize: "db.t4g.micro",
|
|
60
|
+
port: 5432,
|
|
61
|
+
storage: 20,
|
|
62
|
+
private: false
|
|
63
|
+
};
|
|
64
|
+
const mysqlDatabaseService = {
|
|
65
|
+
id: "db",
|
|
66
|
+
name: "Mysql",
|
|
67
|
+
type: "rds",
|
|
68
|
+
engine: "mysql",
|
|
69
|
+
engineVersion: "8",
|
|
70
|
+
instanceSize: "db.t4g.micro",
|
|
71
|
+
port: 3306,
|
|
72
|
+
storage: 20,
|
|
73
|
+
private: false
|
|
74
|
+
};
|
|
75
|
+
const databaseEnvVariables = {
|
|
76
|
+
DATABASE_URL: {
|
|
77
|
+
fromService: { id: "db", value: "dbConnectionString" }
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
export {
|
|
81
|
+
databaseEnvVariables,
|
|
82
|
+
flightcontrolConfig,
|
|
83
|
+
mysqlDatabaseService,
|
|
84
|
+
postgresDatabaseService
|
|
85
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { getConfig } from "../../../../lib/index.js";
|
|
2
|
+
const config = getConfig();
|
|
3
|
+
const NETLIFY_TOML = `[build]
|
|
4
|
+
command = "yarn rw deploy netlify"
|
|
5
|
+
publish = "web/dist"
|
|
6
|
+
functions = "api/dist/functions"
|
|
7
|
+
|
|
8
|
+
[build.environment]
|
|
9
|
+
NODE_VERSION = "20"
|
|
10
|
+
|
|
11
|
+
[[redirects]]
|
|
12
|
+
from = "/*"
|
|
13
|
+
to = "/200.html"
|
|
14
|
+
status = 200
|
|
15
|
+
|
|
16
|
+
# To use Netlify Dev, install Netlify's CLI (\`netlify-cli\`) from NPM and use \`netlify link\`
|
|
17
|
+
# to connect your local project to a site on Netlify. Then run \`netlify dev\`.
|
|
18
|
+
#
|
|
19
|
+
# Quick links to the docs:
|
|
20
|
+
# - Netlfy Dev https://www.netlify.com/products/dev
|
|
21
|
+
# - Netlify's CLI https://docs.netlify.com/cli/get-started/#installation
|
|
22
|
+
# - \`netlify link\` https://docs.netlify.com/cli/get-started/#link-and-unlink-sites
|
|
23
|
+
[dev]
|
|
24
|
+
framework = "redwoodjs"
|
|
25
|
+
# Make sure \`targetPort\` matches \`web.port\` in the \`redwood.toml\`:
|
|
26
|
+
targetPort = ${config.web.port}
|
|
27
|
+
# Point your browser to this port to access your app:
|
|
28
|
+
port = 8888
|
|
29
|
+
`;
|
|
30
|
+
export {
|
|
31
|
+
NETLIFY_TOML
|
|
32
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { getPaths } from "../../../../lib/index.js";
|
|
3
|
+
const PROJECT_NAME = path.basename(getPaths().base);
|
|
4
|
+
const RENDER_YAML = (database) => {
|
|
5
|
+
return `# Quick links to the docs:
|
|
6
|
+
# - Redwood on Render: https://render.com/docs/deploy-redwood
|
|
7
|
+
# - Render's Blueprint spec: https://render.com/docs/yaml-spec
|
|
8
|
+
|
|
9
|
+
services:
|
|
10
|
+
- name: ${PROJECT_NAME}-web
|
|
11
|
+
type: web
|
|
12
|
+
env: static
|
|
13
|
+
buildCommand: corepack enable && yarn install && yarn rw deploy render web
|
|
14
|
+
staticPublishPath: ./web/dist
|
|
15
|
+
|
|
16
|
+
envVars:
|
|
17
|
+
- key: SKIP_INSTALL_DEPS
|
|
18
|
+
value: true
|
|
19
|
+
|
|
20
|
+
routes:
|
|
21
|
+
- type: rewrite
|
|
22
|
+
source: /.redwood/functions/*
|
|
23
|
+
# Replace \`destination\` here after your first deploy:
|
|
24
|
+
#
|
|
25
|
+
# \`\`\`
|
|
26
|
+
# destination: https://my-redwood-project-api.onrender.com/*
|
|
27
|
+
# \`\`\`
|
|
28
|
+
destination: replace_with_api_url/*
|
|
29
|
+
- type: rewrite
|
|
30
|
+
source: /*
|
|
31
|
+
destination: /200.html
|
|
32
|
+
|
|
33
|
+
- name: ${PROJECT_NAME}-api
|
|
34
|
+
type: web
|
|
35
|
+
plan: free
|
|
36
|
+
env: node
|
|
37
|
+
region: oregon
|
|
38
|
+
buildCommand: corepack enable && yarn install && yarn rw build api
|
|
39
|
+
startCommand: yarn rw deploy render api
|
|
40
|
+
|
|
41
|
+
envVars:
|
|
42
|
+
${database}
|
|
43
|
+
`;
|
|
44
|
+
};
|
|
45
|
+
const POSTGRES_YAML = ` - key: DATABASE_URL
|
|
46
|
+
fromDatabase:
|
|
47
|
+
name: ${PROJECT_NAME}-db
|
|
48
|
+
property: connectionString
|
|
49
|
+
|
|
50
|
+
databases:
|
|
51
|
+
- name: ${PROJECT_NAME}-db
|
|
52
|
+
region: oregon`;
|
|
53
|
+
const SQLITE_YAML = ` - key: DATABASE_URL
|
|
54
|
+
value: file:./data/sqlite.db
|
|
55
|
+
disk:
|
|
56
|
+
name: sqlite-data
|
|
57
|
+
mountPath: /opt/render/project/src/api/db/data
|
|
58
|
+
sizeGB: 1`;
|
|
59
|
+
const RENDER_HEALTH_CHECK = `// render-health-check
|
|
60
|
+
export const handler = async () => {
|
|
61
|
+
return {
|
|
62
|
+
statusCode: 200,
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
`;
|
|
66
|
+
export {
|
|
67
|
+
POSTGRES_YAML,
|
|
68
|
+
PROJECT_NAME,
|
|
69
|
+
RENDER_HEALTH_CHECK,
|
|
70
|
+
RENDER_YAML,
|
|
71
|
+
SQLITE_YAML
|
|
72
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import fs from "fs-extra";
|
|
3
|
+
import { getPaths } from "../../../../../lib/index.js";
|
|
4
|
+
const PROJECT_NAME = path.basename(getPaths().base);
|
|
5
|
+
const SERVERLESS_API_YML = `# See the full yml reference at https://www.serverless.com/framework/docs/providers/aws/guide/serverless.yml/
|
|
6
|
+
service: ${PROJECT_NAME}-api
|
|
7
|
+
|
|
8
|
+
# Uncomment \`org\` and \`app\` and enter manually if you want to integrate your
|
|
9
|
+
# deployment with the Serverless dashboard, or run \`yarn serverless\` in ./api to be
|
|
10
|
+
# prompted to connect to an app and these will be filled in for you.
|
|
11
|
+
# See https://www.serverless.com/framework/docs/dashboard/ for more details.
|
|
12
|
+
# org: your-org
|
|
13
|
+
# app: your-app
|
|
14
|
+
|
|
15
|
+
useDotenv: true
|
|
16
|
+
|
|
17
|
+
provider:
|
|
18
|
+
name: aws
|
|
19
|
+
runtime: nodejs18.x
|
|
20
|
+
region: us-east-1 # AWS region where the service will be deployed, defaults to N. Virginia
|
|
21
|
+
httpApi: # HTTP API is used by default. To learn about the available options in API Gateway, see https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-vs-rest.html
|
|
22
|
+
cors:
|
|
23
|
+
allowedOrigins:
|
|
24
|
+
- '*' # This is the default value. You can remove this line if you want to restrict the CORS to a specific origin.
|
|
25
|
+
# allowCredentials: true # allowCredentials should only be used when allowedOrigins doesn't include '*'
|
|
26
|
+
allowedHeaders:
|
|
27
|
+
- authorization
|
|
28
|
+
- auth-provider
|
|
29
|
+
- content-type
|
|
30
|
+
- X-Amz-Date
|
|
31
|
+
- X-Api-Key
|
|
32
|
+
- X-Amz-Security-Token
|
|
33
|
+
- X-Amz-User-Agent
|
|
34
|
+
payload: '1.0'
|
|
35
|
+
stackTags:
|
|
36
|
+
source: serverless
|
|
37
|
+
name: Redwood Lambda API with HTTP API Gateway
|
|
38
|
+
tags:
|
|
39
|
+
name: Redwood Lambda API with HTTP API Gateway
|
|
40
|
+
environment:
|
|
41
|
+
# Add environment variables here, either in the form
|
|
42
|
+
# VARIABLE_NAME: \${env:VARIABLE_NAME} for vars in your local environment, or
|
|
43
|
+
# VARIABLE_NAME: \${param:VARIABLE_NAME} for vars from the Serverless dashboard
|
|
44
|
+
|
|
45
|
+
package:
|
|
46
|
+
individually: true
|
|
47
|
+
patterns:
|
|
48
|
+
- "!node_modules/.prisma/client/libquery_engine-*"
|
|
49
|
+
- "node_modules/.prisma/client/libquery_engine-rhel-*"
|
|
50
|
+
- "!node_modules/prisma/libquery_engine-*"
|
|
51
|
+
- "!node_modules/@prisma/engines/**"
|
|
52
|
+
|
|
53
|
+
${fs.existsSync(path.resolve(getPaths().api.functions)) ? `functions:
|
|
54
|
+
${fs.readdirSync(path.resolve(getPaths().api.functions)).map((file) => {
|
|
55
|
+
const basename = path.parse(file).name;
|
|
56
|
+
return `${basename}:
|
|
57
|
+
description: ${basename} function deployed on AWS Lambda
|
|
58
|
+
package:
|
|
59
|
+
artifact: dist/zipball/${basename}.zip
|
|
60
|
+
memorySize: 1024 # in megabytes
|
|
61
|
+
timeout: 25 # seconds (max: 900 [15 minutes])
|
|
62
|
+
tags: # tags for this specific lambda function
|
|
63
|
+
endpoint: /${basename}
|
|
64
|
+
handler: ${basename}.handler
|
|
65
|
+
events:
|
|
66
|
+
- httpApi: # if a function should be limited to only GET or POST you can remove one or the other here
|
|
67
|
+
path: /${basename}
|
|
68
|
+
method: GET
|
|
69
|
+
- httpApi:
|
|
70
|
+
path: /${basename}
|
|
71
|
+
method: POST
|
|
72
|
+
`;
|
|
73
|
+
}).join(" ")}` : ""}
|
|
74
|
+
`;
|
|
75
|
+
export {
|
|
76
|
+
PROJECT_NAME,
|
|
77
|
+
SERVERLESS_API_YML
|
|
78
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { getPaths } from "../../../../../lib/index.js";
|
|
3
|
+
const PROJECT_NAME = path.basename(getPaths().base);
|
|
4
|
+
const SERVERLESS_WEB_YML = `# See the full yml reference at https://www.serverless.com/framework/docs/providers/aws/guide/serverless.yml/
|
|
5
|
+
service: ${PROJECT_NAME}-web
|
|
6
|
+
|
|
7
|
+
# Uncomment \`org\` and \`app\` and enter manually if you want to integrate your
|
|
8
|
+
# deployment with the Serverless dashboard, or run \`yarn serverless\` in ./web to be
|
|
9
|
+
# prompted to connect to an app and these will be filled in for you.
|
|
10
|
+
# See https://www.serverless.com/framework/docs/dashboard/ for more details.
|
|
11
|
+
# org: your-org
|
|
12
|
+
# app: your-app
|
|
13
|
+
|
|
14
|
+
useDotenv: true
|
|
15
|
+
|
|
16
|
+
plugins:
|
|
17
|
+
- serverless-lift
|
|
18
|
+
|
|
19
|
+
constructs:
|
|
20
|
+
web:
|
|
21
|
+
type: static-website
|
|
22
|
+
path: dist
|
|
23
|
+
|
|
24
|
+
provider:
|
|
25
|
+
name: aws
|
|
26
|
+
runtime: nodejs18.x
|
|
27
|
+
region: us-east-1 # AWS region where the service will be deployed, defaults to N. Virgina
|
|
28
|
+
`;
|
|
29
|
+
export {
|
|
30
|
+
PROJECT_NAME,
|
|
31
|
+
SERVERLESS_WEB_YML
|
|
32
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
2
|
+
const command = "docker";
|
|
3
|
+
const description = "Setup the default Redwood Dockerfile";
|
|
4
|
+
function builder(yargs) {
|
|
5
|
+
yargs.option("force", {
|
|
6
|
+
alias: "f",
|
|
7
|
+
default: false,
|
|
8
|
+
description: "Overwrite existing configuration",
|
|
9
|
+
type: "boolean"
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
async function handler(options) {
|
|
13
|
+
recordTelemetryAttributes({
|
|
14
|
+
command: "setup docker",
|
|
15
|
+
force: options.force,
|
|
16
|
+
verbose: options.verbose
|
|
17
|
+
});
|
|
18
|
+
const { handler: handler2 } = await import("./dockerHandler.js");
|
|
19
|
+
return handler2(options);
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
builder,
|
|
23
|
+
command,
|
|
24
|
+
description,
|
|
25
|
+
handler
|
|
26
|
+
};
|