@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,55 @@
|
|
|
1
|
+
import { diag, DiagConsoleLogger, DiagLogLevel } from '@opentelemetry/api'
|
|
2
|
+
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http'
|
|
3
|
+
import { registerInstrumentations } from '@opentelemetry/instrumentation'
|
|
4
|
+
import { FastifyInstrumentation } from '@opentelemetry/instrumentation-fastify'
|
|
5
|
+
import { HttpInstrumentation } from '@opentelemetry/instrumentation-http'
|
|
6
|
+
import { Resource } from '@opentelemetry/resources'
|
|
7
|
+
import {
|
|
8
|
+
NodeTracerProvider,
|
|
9
|
+
SimpleSpanProcessor,
|
|
10
|
+
} from '@opentelemetry/sdk-trace-node'
|
|
11
|
+
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions'
|
|
12
|
+
import { PrismaInstrumentation } from '@prisma/instrumentation'
|
|
13
|
+
|
|
14
|
+
import { getConfig } from '@cedarjs/project-config'
|
|
15
|
+
|
|
16
|
+
// You may wish to set this to DiagLogLevel.DEBUG when you need to debug opentelemetry itself
|
|
17
|
+
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.INFO)
|
|
18
|
+
|
|
19
|
+
const resource = Resource.default().merge(
|
|
20
|
+
new Resource({
|
|
21
|
+
[SemanticResourceAttributes.SERVICE_NAME]: 'redwood-app',
|
|
22
|
+
[SemanticResourceAttributes.SERVICE_VERSION]: '0.0.0',
|
|
23
|
+
})
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
const studioPort = getConfig().studio.basePort
|
|
27
|
+
const exporter = new OTLPTraceExporter({
|
|
28
|
+
// Update this URL to point to where your OTLP compatible collector is listening
|
|
29
|
+
// The redwood development studio (`yarn rw exp studio`) can collect your
|
|
30
|
+
// telemetry at `http://127.0.0.1:<PORT>/v1/traces` (default PORT is 4318)
|
|
31
|
+
url: `http://127.0.0.1:${studioPort}/.redwood/functions/otel-trace`,
|
|
32
|
+
concurrencyLimit: 64,
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
// You may wish to switch to BatchSpanProcessor in production as it is the recommended choice for performance reasons
|
|
36
|
+
const processor = new SimpleSpanProcessor(exporter)
|
|
37
|
+
|
|
38
|
+
const provider = new NodeTracerProvider({
|
|
39
|
+
resource: resource,
|
|
40
|
+
})
|
|
41
|
+
provider.addSpanProcessor(processor)
|
|
42
|
+
|
|
43
|
+
// Optionally register instrumentation libraries here
|
|
44
|
+
registerInstrumentations({
|
|
45
|
+
tracerProvider: provider,
|
|
46
|
+
instrumentations: [
|
|
47
|
+
new HttpInstrumentation(),
|
|
48
|
+
new FastifyInstrumentation(),
|
|
49
|
+
new PrismaInstrumentation({
|
|
50
|
+
middleware: true,
|
|
51
|
+
}),
|
|
52
|
+
],
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
provider.register()
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import React from 'react'
|
|
4
|
+
|
|
5
|
+
// @ts-expect-error no types
|
|
6
|
+
import styles from './Counter.module.css'
|
|
7
|
+
import './Counter.css'
|
|
8
|
+
|
|
9
|
+
export const AboutCounter = () => {
|
|
10
|
+
const [count, setCount] = React.useState(0)
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<div style={{ border: '3px blue dashed', margin: '1em', padding: '1em' }}>
|
|
14
|
+
<p>Count: {count}</p>
|
|
15
|
+
<button onClick={() => setCount((c) => c + 1)}>Increment</button>
|
|
16
|
+
<h3 className={styles.header}>This is a client component.</h3>
|
|
17
|
+
<p>RSC on client: {globalThis.RWJS_EXP_RSC ? 'enabled' : 'disabled'}</p>
|
|
18
|
+
</div>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AboutCounter } from 'src/components/Counter/AboutCounter'
|
|
2
|
+
|
|
3
|
+
import './AboutPage.css'
|
|
4
|
+
|
|
5
|
+
const AboutPage = () => {
|
|
6
|
+
return (
|
|
7
|
+
<div className="about-page">
|
|
8
|
+
<div style={{ border: '3px red dashed', margin: '1em', padding: '1em' }}>
|
|
9
|
+
<h1>About Redwood</h1>
|
|
10
|
+
<AboutCounter />
|
|
11
|
+
<p>RSC on server: {globalThis.RWJS_EXP_RSC ? 'enabled' : 'disabled'}</p>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default AboutPage
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import React from 'react'
|
|
4
|
+
|
|
5
|
+
import styles from './Counter.module.css'
|
|
6
|
+
import './Counter.css'
|
|
7
|
+
|
|
8
|
+
export const Counter = () => {
|
|
9
|
+
const [count, setCount] = React.useState(0)
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<div style={{ border: '3px blue dashed', margin: '1em', padding: '1em' }}>
|
|
13
|
+
<p>Count: {count}</p>
|
|
14
|
+
<button onClick={() => setCount((c) => c + 1)}>Increment</button>
|
|
15
|
+
<h3 className={styles.header}>This is a client component.</h3>
|
|
16
|
+
</div>
|
|
17
|
+
)
|
|
18
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { Css, Meta } from '@cedarjs/web/htmlTags'
|
|
4
|
+
import type { TagDescriptor } from '@cedarjs/web/htmlTags'
|
|
5
|
+
|
|
6
|
+
interface DocumentProps {
|
|
7
|
+
children: React.ReactNode
|
|
8
|
+
css: string[] // array of css import strings
|
|
9
|
+
meta?: TagDescriptor[]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const Document: React.FC<DocumentProps> = ({ children, css, meta }) => {
|
|
13
|
+
return (
|
|
14
|
+
<html lang="en">
|
|
15
|
+
<head>
|
|
16
|
+
<meta charSet="utf-8" />
|
|
17
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
18
|
+
<link rel="icon" type="image/png" href="/favicon.png" />
|
|
19
|
+
<Css css={css} />
|
|
20
|
+
<Meta tags={meta} />
|
|
21
|
+
</head>
|
|
22
|
+
<body>
|
|
23
|
+
<div id="redwood-app">{children}</div>
|
|
24
|
+
</body>
|
|
25
|
+
</html>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Counter } from 'src/components/Counter/Counter'
|
|
2
|
+
|
|
3
|
+
import styles from './HomePage.module.css'
|
|
4
|
+
|
|
5
|
+
import './HomePage.css'
|
|
6
|
+
|
|
7
|
+
const HomePage = ({ name = 'Anonymous' }) => {
|
|
8
|
+
return (
|
|
9
|
+
<div className="home-page">
|
|
10
|
+
<div style={{ border: '3px red dashed', margin: '1em', padding: '1em' }}>
|
|
11
|
+
<h1 className={styles.title}>Hello {name}!!</h1>
|
|
12
|
+
<h3>This is a server component.</h3>
|
|
13
|
+
<Counter />
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default HomePage
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
.navigation-layout {
|
|
2
|
+
& nav {
|
|
3
|
+
display: flex;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
align-items: center;
|
|
6
|
+
padding: 10px;
|
|
7
|
+
background-color: color-mix(in srgb, yellow 50%, transparent);
|
|
8
|
+
border-bottom: 2px dashed color-mix(in srgb, yellow 90%, black);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
& ul {
|
|
12
|
+
list-style: none;
|
|
13
|
+
display: flex;
|
|
14
|
+
margin: 0;
|
|
15
|
+
padding: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
& li {
|
|
19
|
+
margin-right: 10px;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
& a {
|
|
23
|
+
text-decoration: none;
|
|
24
|
+
color: #333;
|
|
25
|
+
padding: 5px;
|
|
26
|
+
border-bottom: 2px solid transparent;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
& a:hover {
|
|
30
|
+
border-bottom: 2px solid #333;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { namedRoutes as routes } from '@cedarjs/router/dist/namedRoutes'
|
|
2
|
+
|
|
3
|
+
import './NavigationLayout.css'
|
|
4
|
+
|
|
5
|
+
const Link = (props: any) => {
|
|
6
|
+
return <a href={props.to}>{props.children}</a>
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
type NavigationLayoutProps = {
|
|
10
|
+
children?: React.ReactNode
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const NavigationLayout = ({ children }: NavigationLayoutProps) => {
|
|
14
|
+
return (
|
|
15
|
+
<div className="navigation-layout">
|
|
16
|
+
<nav>
|
|
17
|
+
<ul>
|
|
18
|
+
<li>
|
|
19
|
+
<Link to={routes.home()}>Home</Link>
|
|
20
|
+
</li>
|
|
21
|
+
<li>
|
|
22
|
+
<Link to={routes.about()}>About</Link>
|
|
23
|
+
</li>
|
|
24
|
+
</ul>
|
|
25
|
+
</nav>
|
|
26
|
+
<main>{children}</main>
|
|
27
|
+
</div>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default NavigationLayout
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// In this file, all Page components from 'src/pages` are auto-imported. Nested
|
|
2
|
+
// directories are supported, and should be uppercase. Each subdirectory will be
|
|
3
|
+
// prepended onto the component name.
|
|
4
|
+
//
|
|
5
|
+
// Examples:
|
|
6
|
+
//
|
|
7
|
+
// 'src/pages/HomePage/HomePage.js' -> HomePage
|
|
8
|
+
// 'src/pages/Admin/BooksPage/BooksPage.js' -> AdminBooksPage
|
|
9
|
+
|
|
10
|
+
import { Route } from '@cedarjs/router/Route'
|
|
11
|
+
import { Router } from '@cedarjs/router/RscRouter'
|
|
12
|
+
import { Set } from '@cedarjs/router/Set'
|
|
13
|
+
|
|
14
|
+
import NavigationLayout from 'src/layouts/NavigationLayout'
|
|
15
|
+
import NotFoundPage from 'src/pages/NotFoundPage'
|
|
16
|
+
|
|
17
|
+
const Routes = () => {
|
|
18
|
+
return (
|
|
19
|
+
<Router>
|
|
20
|
+
<Set wrap={NavigationLayout}>
|
|
21
|
+
<Route path="/" page={HomePage} name="home" />
|
|
22
|
+
<Route path="/about" page={AboutPage} name="about" />
|
|
23
|
+
</Set>
|
|
24
|
+
<Route notfound page={NotFoundPage} />
|
|
25
|
+
</Router>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default Routes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { hydrateRoot, createRoot } from 'react-dom/client'
|
|
2
|
+
|
|
3
|
+
import App from './App'
|
|
4
|
+
import Routes from './Routes'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* When `#redwood-app` isn't empty then it's very likely that you're using
|
|
8
|
+
* pre-rendering. So React attaches event listeners to the existing markup
|
|
9
|
+
* rather than replacing it.
|
|
10
|
+
* https://react.dev/reference/react-dom/client/hydrateRoot
|
|
11
|
+
*/
|
|
12
|
+
const redwoodAppElement = document.getElementById('redwood-app')
|
|
13
|
+
|
|
14
|
+
if (!redwoodAppElement) {
|
|
15
|
+
throw new Error(
|
|
16
|
+
"Could not find an element with ID 'redwood-app'. Please ensure it " +
|
|
17
|
+
"exists in your 'web/src/index.html' file."
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (redwoodAppElement.children?.length > 0) {
|
|
22
|
+
hydrateRoot(
|
|
23
|
+
redwoodAppElement,
|
|
24
|
+
<App>
|
|
25
|
+
<Routes />
|
|
26
|
+
</App>
|
|
27
|
+
)
|
|
28
|
+
} else {
|
|
29
|
+
const root = createRoot(redwoodAppElement)
|
|
30
|
+
root.render(
|
|
31
|
+
<App>
|
|
32
|
+
<Routes />
|
|
33
|
+
</App>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TagDescriptor } from '@cedarjs/web/htmlTags'
|
|
2
|
+
|
|
3
|
+
import App from './App'
|
|
4
|
+
import { Document } from './Document'
|
|
5
|
+
import Routes from './Routes'
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
css: string[]
|
|
9
|
+
meta?: TagDescriptor[]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const ServerEntry: React.FC<Props> = ({ css, meta }) => {
|
|
13
|
+
return (
|
|
14
|
+
<Document css={css} meta={meta}>
|
|
15
|
+
<App>
|
|
16
|
+
<Routes />
|
|
17
|
+
</App>
|
|
18
|
+
</Document>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { Css, Meta } from '@cedarjs/web/htmlTags'
|
|
4
|
+
import type { TagDescriptor } from '@cedarjs/web/htmlTags'
|
|
5
|
+
|
|
6
|
+
interface DocumentProps {
|
|
7
|
+
children: React.ReactNode
|
|
8
|
+
css: string[] // array of css import strings
|
|
9
|
+
meta?: TagDescriptor[]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const Document: React.FC<DocumentProps> = ({ children, css, meta }) => {
|
|
13
|
+
return (
|
|
14
|
+
<html lang="en">
|
|
15
|
+
<head>
|
|
16
|
+
<meta charSet="utf-8" />
|
|
17
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
18
|
+
<link rel="icon" type="image/png" href="/favicon.png" />
|
|
19
|
+
<Css css={css} />
|
|
20
|
+
<Meta tags={meta} />
|
|
21
|
+
</head>
|
|
22
|
+
<body>
|
|
23
|
+
<div id="redwood-app">{children}</div>
|
|
24
|
+
</body>
|
|
25
|
+
</html>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { hydrateRoot, createRoot } from 'react-dom/client'
|
|
2
|
+
|
|
3
|
+
import App from './App'
|
|
4
|
+
import { Document } from './Document'
|
|
5
|
+
import Routes from './Routes'
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* When `#redwood-app` isn't empty then it's very likely that you're using
|
|
9
|
+
* prerendering. So React attaches event listeners to the existing markup
|
|
10
|
+
* rather than replacing it.
|
|
11
|
+
* https://react.dev/reference/react-dom/client/hydrateRoot
|
|
12
|
+
*/
|
|
13
|
+
const redwoodAppElement = document.getElementById('redwood-app')
|
|
14
|
+
|
|
15
|
+
if (!redwoodAppElement) {
|
|
16
|
+
throw new Error(
|
|
17
|
+
"Could not find an element with ID 'redwood-app'. Please ensure it " +
|
|
18
|
+
"exists in your 'web/src/index.html' file."
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (redwoodAppElement.children?.length > 0) {
|
|
23
|
+
hydrateRoot(
|
|
24
|
+
document,
|
|
25
|
+
<Document css={window.__assetMap?.()?.css}>
|
|
26
|
+
<App>
|
|
27
|
+
<Routes />
|
|
28
|
+
</App>
|
|
29
|
+
</Document>
|
|
30
|
+
)
|
|
31
|
+
} else {
|
|
32
|
+
const root = createRoot(document)
|
|
33
|
+
root.render(
|
|
34
|
+
<Document css={window.__assetMap?.()?.css}>
|
|
35
|
+
<App>
|
|
36
|
+
<Routes />
|
|
37
|
+
</App>
|
|
38
|
+
</Document>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TagDescriptor } from '@cedarjs/web'
|
|
2
|
+
|
|
3
|
+
import App from './App'
|
|
4
|
+
import { Document } from './Document'
|
|
5
|
+
import Routes from './Routes'
|
|
6
|
+
|
|
7
|
+
interface Props {
|
|
8
|
+
css: string[]
|
|
9
|
+
meta?: TagDescriptor[]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const ServerEntry: React.FC<Props> = ({ css, meta }) => {
|
|
13
|
+
return (
|
|
14
|
+
<Document css={css} meta={meta}>
|
|
15
|
+
<App>
|
|
16
|
+
<Routes />
|
|
17
|
+
</App>
|
|
18
|
+
</Document>
|
|
19
|
+
)
|
|
20
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"noEmit": true,
|
|
4
|
+
"allowJs": true,
|
|
5
|
+
"esModuleInterop": true,
|
|
6
|
+
"target": "esnext",
|
|
7
|
+
"module": "NodeNext",
|
|
8
|
+
"moduleResolution": "NodeNext",
|
|
9
|
+
"skipLibCheck": false,
|
|
10
|
+
"rootDirs": [
|
|
11
|
+
"./src",
|
|
12
|
+
"../.redwood/types/mirror/web/src",
|
|
13
|
+
"../api/src",
|
|
14
|
+
"../.redwood/types/mirror/api/src"
|
|
15
|
+
],
|
|
16
|
+
"paths": {
|
|
17
|
+
"src/*": [
|
|
18
|
+
"./src/*",
|
|
19
|
+
"../.redwood/types/mirror/web/src/*",
|
|
20
|
+
"../api/src/*",
|
|
21
|
+
"../.redwood/types/mirror/api/src/*"
|
|
22
|
+
],
|
|
23
|
+
"$api/*": [
|
|
24
|
+
"../api/*"
|
|
25
|
+
],
|
|
26
|
+
"types/*": [
|
|
27
|
+
"./types/*",
|
|
28
|
+
"../types/*"
|
|
29
|
+
],
|
|
30
|
+
"@cedarjs/testing": [
|
|
31
|
+
"../node_modules/@cedarjs/testing/web"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"typeRoots": [
|
|
35
|
+
"../node_modules/@types",
|
|
36
|
+
"./node_modules/@types",
|
|
37
|
+
"../node_modules/@testing-library"
|
|
38
|
+
],
|
|
39
|
+
"types": [
|
|
40
|
+
"jest",
|
|
41
|
+
"jest-dom",
|
|
42
|
+
"react/experimental"
|
|
43
|
+
],
|
|
44
|
+
"jsx": "preserve"
|
|
45
|
+
},
|
|
46
|
+
"include": [
|
|
47
|
+
"src",
|
|
48
|
+
"config",
|
|
49
|
+
"../.redwood/types/includes/all-*",
|
|
50
|
+
"../.redwood/types/includes/web-*",
|
|
51
|
+
"../types",
|
|
52
|
+
"./types"
|
|
53
|
+
]
|
|
54
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import fs from "fs-extra";
|
|
4
|
+
import terminalLink from "terminal-link";
|
|
5
|
+
import { getPaths } from "../../lib/index.js";
|
|
6
|
+
import { isTypeScriptProject, serverFileExists } from "../../lib/project.js";
|
|
7
|
+
const link = (topicId, isTerminal = false) => {
|
|
8
|
+
const communityLink = `https://community.redwoodjs.com/t/${topicId}`;
|
|
9
|
+
if (isTerminal) {
|
|
10
|
+
return terminalLink(communityLink, communityLink);
|
|
11
|
+
} else {
|
|
12
|
+
return communityLink;
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
const getEpilogue = (command, description, topicId, isTerminal = false) => `This is an experimental feature to: ${description}.
|
|
16
|
+
|
|
17
|
+
Please find documentation and links to provide feedback for ${command} at:
|
|
18
|
+
-> ${link(
|
|
19
|
+
topicId,
|
|
20
|
+
isTerminal
|
|
21
|
+
)}`;
|
|
22
|
+
const printTaskEpilogue = (command, description, topicId) => {
|
|
23
|
+
console.log(
|
|
24
|
+
`${chalk.hex("#ff845e")(
|
|
25
|
+
`------------------------------------------------------------------
|
|
26
|
+
\u{1F9EA} ${chalk.green(
|
|
27
|
+
"Experimental Feature"
|
|
28
|
+
)} \u{1F9EA}
|
|
29
|
+
------------------------------------------------------------------`
|
|
30
|
+
)}`
|
|
31
|
+
);
|
|
32
|
+
console.log(getEpilogue(command, description, topicId, false));
|
|
33
|
+
console.log(
|
|
34
|
+
`${chalk.hex("#ff845e")(
|
|
35
|
+
"------------------------------------------------------------------"
|
|
36
|
+
)}
|
|
37
|
+
`
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
const isServerFileSetup = () => {
|
|
41
|
+
if (!serverFileExists()) {
|
|
42
|
+
throw new Error(
|
|
43
|
+
"RedwoodJS Realtime requires a serverful environment. Please run `yarn rw setup server-file` first."
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
return true;
|
|
47
|
+
};
|
|
48
|
+
const realtimeExists = () => {
|
|
49
|
+
const realtimePath = path.join(
|
|
50
|
+
getPaths().api.lib,
|
|
51
|
+
`realtime.${isTypeScriptProject() ? "ts" : "js"}`
|
|
52
|
+
);
|
|
53
|
+
return fs.existsSync(realtimePath);
|
|
54
|
+
};
|
|
55
|
+
const isRealtimeSetup = () => {
|
|
56
|
+
if (!realtimeExists) {
|
|
57
|
+
throw new Error(
|
|
58
|
+
"Adding realtime events requires that RedwoodJS Realtime be setup. Please run `yarn setup realtime` first."
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
return true;
|
|
62
|
+
};
|
|
63
|
+
export {
|
|
64
|
+
getEpilogue,
|
|
65
|
+
isRealtimeSetup,
|
|
66
|
+
isServerFileSetup,
|
|
67
|
+
printTaskEpilogue,
|
|
68
|
+
realtimeExists
|
|
69
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import terminalLink from "terminal-link";
|
|
2
|
+
import detectRxVersion from "../middleware/detectProjectRxVersion.js";
|
|
3
|
+
import * as experimentalInngest from "./experimental/setupInngest.js";
|
|
4
|
+
import * as experimentalOpenTelemetry from "./experimental/setupOpentelemetry.js";
|
|
5
|
+
import * as experimentalReactCompiler from "./experimental/setupReactCompiler.js";
|
|
6
|
+
import * as experimentalRsc from "./experimental/setupRsc.js";
|
|
7
|
+
import * as experimentalStreamingSsr from "./experimental/setupStreamingSsr.js";
|
|
8
|
+
const command = "experimental <command>";
|
|
9
|
+
const aliases = ["exp"];
|
|
10
|
+
const description = "Run or setup experimental features";
|
|
11
|
+
const builder = (yargs) => yargs.command(experimentalInngest).command(experimentalOpenTelemetry).command(experimentalReactCompiler).command(experimentalRsc).command(experimentalStreamingSsr).demandCommand().middleware(detectRxVersion).epilogue(
|
|
12
|
+
`Also see the ${terminalLink(
|
|
13
|
+
"Redwood CLI Reference",
|
|
14
|
+
"https://redwoodjs.com/docs/cli-commands#experimental"
|
|
15
|
+
)}`
|
|
16
|
+
);
|
|
17
|
+
export {
|
|
18
|
+
aliases,
|
|
19
|
+
builder,
|
|
20
|
+
command,
|
|
21
|
+
description
|
|
22
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createCommand,
|
|
3
|
+
createDescription,
|
|
4
|
+
createBuilder,
|
|
5
|
+
getYargsDefaults,
|
|
6
|
+
createHandler
|
|
7
|
+
} from "../yargsCommandHelpers.js";
|
|
8
|
+
const command = createCommand("cell");
|
|
9
|
+
const description = createDescription("cell");
|
|
10
|
+
const builder = createBuilder({
|
|
11
|
+
componentName: "cell",
|
|
12
|
+
optionsObj: () => {
|
|
13
|
+
return {
|
|
14
|
+
...getYargsDefaults(),
|
|
15
|
+
list: {
|
|
16
|
+
alias: "l",
|
|
17
|
+
default: false,
|
|
18
|
+
description: "Use when you want to generate a cell for a list of the model name.",
|
|
19
|
+
type: "boolean"
|
|
20
|
+
},
|
|
21
|
+
query: {
|
|
22
|
+
default: "",
|
|
23
|
+
description: "Use to enforce a specific query name within the generated cell - must be unique.",
|
|
24
|
+
type: "string"
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
const handler = createHandler("cell");
|
|
30
|
+
export {
|
|
31
|
+
builder,
|
|
32
|
+
command,
|
|
33
|
+
description,
|
|
34
|
+
handler
|
|
35
|
+
};
|