@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,31 @@
|
|
|
1
|
+
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
2
|
+
const command = "server-file";
|
|
3
|
+
const description = "Setup the server file";
|
|
4
|
+
function builder(yargs) {
|
|
5
|
+
yargs.option("force", {
|
|
6
|
+
alias: "f",
|
|
7
|
+
default: false,
|
|
8
|
+
description: "Overwrite existing configuration",
|
|
9
|
+
type: "boolean"
|
|
10
|
+
}).option("verbose", {
|
|
11
|
+
alias: "v",
|
|
12
|
+
default: false,
|
|
13
|
+
description: "Print more logs",
|
|
14
|
+
type: "boolean"
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
async function handler(options) {
|
|
18
|
+
recordTelemetryAttributes({
|
|
19
|
+
command: "setup server-file",
|
|
20
|
+
force: options.force,
|
|
21
|
+
verbose: options.verbose
|
|
22
|
+
});
|
|
23
|
+
const { handler: handler2 } = await import("./serverFileHandler.js");
|
|
24
|
+
return handler2(options);
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
builder,
|
|
28
|
+
command,
|
|
29
|
+
description,
|
|
30
|
+
handler
|
|
31
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import fs from "fs-extra";
|
|
3
|
+
import { Listr } from "listr2";
|
|
4
|
+
import { addApiPackages } from "@cedarjs/cli-helpers";
|
|
5
|
+
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
6
|
+
import c from "../../../lib/colors.js";
|
|
7
|
+
import { getPaths, transformTSToJS, writeFile } from "../../../lib/index.js";
|
|
8
|
+
import { isTypeScriptProject } from "../../../lib/project.js";
|
|
9
|
+
const { version } = JSON.parse(
|
|
10
|
+
fs.readFileSync(
|
|
11
|
+
path.resolve(import.meta.dirname, "../../../../package.json"),
|
|
12
|
+
"utf-8"
|
|
13
|
+
)
|
|
14
|
+
);
|
|
15
|
+
function setupServerFileTasks({ force = false } = {}) {
|
|
16
|
+
return [
|
|
17
|
+
{
|
|
18
|
+
title: "Adding the server file...",
|
|
19
|
+
task: async () => {
|
|
20
|
+
const ts = isTypeScriptProject();
|
|
21
|
+
const serverFilePath = path.join(
|
|
22
|
+
getPaths().api.src,
|
|
23
|
+
`server.${ts ? "ts" : "js"}`
|
|
24
|
+
);
|
|
25
|
+
const serverFileTemplateContent = fs.readFileSync(
|
|
26
|
+
path.join(import.meta.dirname, "templates", "server.ts.template"),
|
|
27
|
+
"utf-8"
|
|
28
|
+
);
|
|
29
|
+
const setupScriptContent = ts ? serverFileTemplateContent : await transformTSToJS(serverFilePath, serverFileTemplateContent);
|
|
30
|
+
return [
|
|
31
|
+
writeFile(serverFilePath, setupScriptContent, {
|
|
32
|
+
overwriteExisting: force
|
|
33
|
+
})
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
addApiPackages([`@cedarjs/api-server@${version}`])
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
async function handler({ force, verbose }) {
|
|
41
|
+
const tasks = new Listr(setupServerFileTasks({ force }), {
|
|
42
|
+
rendererOptions: { collapseSubtasks: false, persistentOutput: true },
|
|
43
|
+
renderer: verbose ? "verbose" : "default"
|
|
44
|
+
});
|
|
45
|
+
try {
|
|
46
|
+
await tasks.run();
|
|
47
|
+
} catch (e) {
|
|
48
|
+
errorTelemetry(process.argv, e.message);
|
|
49
|
+
console.error(c.error(e.message));
|
|
50
|
+
process.exit(e?.exitCode || 1);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
handler,
|
|
55
|
+
setupServerFileTasks
|
|
56
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
2
|
+
const command = "tsconfig";
|
|
3
|
+
const description = "Set up tsconfig for web and api sides";
|
|
4
|
+
const builder = (yargs) => {
|
|
5
|
+
yargs.option("force", {
|
|
6
|
+
alias: "f",
|
|
7
|
+
default: false,
|
|
8
|
+
description: "Overwrite existing tsconfig.json files",
|
|
9
|
+
type: "boolean"
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
const handler = async (options) => {
|
|
13
|
+
recordTelemetryAttributes({
|
|
14
|
+
command: "setup tsconfig",
|
|
15
|
+
force: options.force
|
|
16
|
+
});
|
|
17
|
+
const { handler: handler2 } = await import("./tsconfigHandler.js");
|
|
18
|
+
return handler2(options);
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
builder,
|
|
22
|
+
command,
|
|
23
|
+
description,
|
|
24
|
+
handler
|
|
25
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { Listr } from "listr2";
|
|
3
|
+
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
4
|
+
import c from "../../../lib/colors.js";
|
|
5
|
+
import {
|
|
6
|
+
getInstalledCedarVersion,
|
|
7
|
+
getPaths,
|
|
8
|
+
saveRemoteFileToDisk
|
|
9
|
+
} from "../../../lib/index.js";
|
|
10
|
+
const handler = async ({ force }) => {
|
|
11
|
+
const installedRwVersion = await getInstalledCedarVersion();
|
|
12
|
+
const GITHUB_VERSION_TAG = installedRwVersion.match("canary") ? "main" : `v${installedRwVersion}`;
|
|
13
|
+
const CRWA_TEMPLATE_URL = `https://raw.githubusercontent.com/redwoodjs/redwood/${GITHUB_VERSION_TAG}/packages/create-cedar-app/templates/ts`;
|
|
14
|
+
const tasks = new Listr(
|
|
15
|
+
[
|
|
16
|
+
{
|
|
17
|
+
title: "Creating tsconfig in web",
|
|
18
|
+
task: () => {
|
|
19
|
+
const webConfigPath = path.join(getPaths().web.base, "tsconfig.json");
|
|
20
|
+
const templateUrl = `${CRWA_TEMPLATE_URL}/web/tsconfig.json`;
|
|
21
|
+
return saveRemoteFileToDisk(templateUrl, webConfigPath, {
|
|
22
|
+
overwriteExisting: force
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
title: "Creating tsconfig in api",
|
|
28
|
+
task: () => {
|
|
29
|
+
const webConfigPath = path.join(getPaths().api.base, "tsconfig.json");
|
|
30
|
+
const templateUrl = `${CRWA_TEMPLATE_URL}/api/tsconfig.json`;
|
|
31
|
+
return saveRemoteFileToDisk(templateUrl, webConfigPath, {
|
|
32
|
+
overwriteExisting: force
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
title: "One more thing...",
|
|
38
|
+
task: (_ctx, task) => {
|
|
39
|
+
task.title = `One more thing...
|
|
40
|
+
|
|
41
|
+
${c.tip("Quick link to the docs on configuring TypeScript")}
|
|
42
|
+
${c.link("https://redwoodjs.com/docs/typescript")}
|
|
43
|
+
`;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
{ rendererOptions: { collapseSubtasks: false } }
|
|
48
|
+
);
|
|
49
|
+
try {
|
|
50
|
+
await tasks.run();
|
|
51
|
+
} catch (e) {
|
|
52
|
+
errorTelemetry(process.argv, e.message);
|
|
53
|
+
console.error(c.error(e.message));
|
|
54
|
+
process.exit(e?.exitCode || 1);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
handler
|
|
59
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createHandler } from "../helpers/helpers.js";
|
|
2
|
+
const command = "chakra-ui";
|
|
3
|
+
const description = "Set up Chakra UI";
|
|
4
|
+
function builder(yargs) {
|
|
5
|
+
yargs.option("force", {
|
|
6
|
+
alias: "f",
|
|
7
|
+
default: false,
|
|
8
|
+
description: "Overwrite existing configuration",
|
|
9
|
+
type: "boolean"
|
|
10
|
+
});
|
|
11
|
+
yargs.option("install", {
|
|
12
|
+
alias: "i",
|
|
13
|
+
default: true,
|
|
14
|
+
description: "Install packages",
|
|
15
|
+
type: "boolean"
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
const handler = createHandler(command);
|
|
19
|
+
export {
|
|
20
|
+
builder,
|
|
21
|
+
command,
|
|
22
|
+
description,
|
|
23
|
+
handler
|
|
24
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import execa from "execa";
|
|
3
|
+
import { Listr } from "listr2";
|
|
4
|
+
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
5
|
+
import c from "../../../../lib/colors.js";
|
|
6
|
+
import extendStorybookConfiguration from "../../../../lib/configureStorybook.js";
|
|
7
|
+
import { extendJSXFile, fileIncludes } from "../../../../lib/extendFile.js";
|
|
8
|
+
import { getPaths, writeFile } from "../../../../lib/index.js";
|
|
9
|
+
const CHAKRA_THEME_AND_COMMENTS = `// This object will be used to override Chakra-UI theme defaults.
|
|
10
|
+
// See https://chakra-ui.com/docs/styled-system/theming/theme for theming options
|
|
11
|
+
const theme = {}
|
|
12
|
+
export default theme
|
|
13
|
+
`;
|
|
14
|
+
async function handler({ force, install }) {
|
|
15
|
+
recordTelemetryAttributes({
|
|
16
|
+
command: "setup ui chakra-ui",
|
|
17
|
+
force,
|
|
18
|
+
install
|
|
19
|
+
});
|
|
20
|
+
const rwPaths = getPaths();
|
|
21
|
+
const packages = [
|
|
22
|
+
"@chakra-ui/react@^2",
|
|
23
|
+
"@emotion/react@^11",
|
|
24
|
+
"@emotion/styled@^11",
|
|
25
|
+
"framer-motion@^11"
|
|
26
|
+
];
|
|
27
|
+
const tasks = new Listr(
|
|
28
|
+
[
|
|
29
|
+
{
|
|
30
|
+
title: "Installing packages...",
|
|
31
|
+
skip: () => !install,
|
|
32
|
+
task: () => {
|
|
33
|
+
return new Listr(
|
|
34
|
+
[
|
|
35
|
+
{
|
|
36
|
+
title: `Install ${packages.join(", ")}`,
|
|
37
|
+
task: async () => {
|
|
38
|
+
await execa("yarn", ["workspace", "web", "add", ...packages]);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
{ rendererOptions: { collapseSubtasks: false } }
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
title: "Setting up Chakra UI...",
|
|
48
|
+
skip: () => fileIncludes(rwPaths.web.app, "ChakraProvider"),
|
|
49
|
+
task: () => extendJSXFile(rwPaths.web.app, {
|
|
50
|
+
insertComponent: {
|
|
51
|
+
name: "ChakraProvider",
|
|
52
|
+
props: { theme: "extendedTheme" },
|
|
53
|
+
within: "RedwoodProvider",
|
|
54
|
+
insertBefore: "<ColorModeScript />"
|
|
55
|
+
},
|
|
56
|
+
imports: [
|
|
57
|
+
"import { ChakraProvider, ColorModeScript, extendTheme } from '@chakra-ui/react'",
|
|
58
|
+
"import * as theme from 'config/chakra.config'"
|
|
59
|
+
],
|
|
60
|
+
moduleScopeLines: ["const extendedTheme = extendTheme(theme)"]
|
|
61
|
+
})
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
title: `Creating Theme File...`,
|
|
65
|
+
task: () => {
|
|
66
|
+
writeFile(
|
|
67
|
+
path.join(rwPaths.web.config, "chakra.config.js"),
|
|
68
|
+
CHAKRA_THEME_AND_COMMENTS,
|
|
69
|
+
{ overwriteExisting: force }
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
title: "Configure Storybook...",
|
|
75
|
+
// skip this task if the user's storybook config already includes "withChakra"
|
|
76
|
+
skip: () => fileIncludes(rwPaths.web.storybookConfig, "withChakra"),
|
|
77
|
+
task: async () => extendStorybookConfiguration(
|
|
78
|
+
path.join(
|
|
79
|
+
import.meta.dirname,
|
|
80
|
+
"..",
|
|
81
|
+
"templates",
|
|
82
|
+
"chakra.storybook.preview.tsx.template"
|
|
83
|
+
)
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
|
+
],
|
|
87
|
+
{ rendererOptions: { collapseSubtasks: false } }
|
|
88
|
+
);
|
|
89
|
+
try {
|
|
90
|
+
await tasks.run();
|
|
91
|
+
} catch (e) {
|
|
92
|
+
console.error(c.error(e.message));
|
|
93
|
+
process.exit(e?.exitCode || 1);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
export {
|
|
97
|
+
handler
|
|
98
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createHandler } from "../helpers/helpers.js";
|
|
2
|
+
const command = "mantine";
|
|
3
|
+
const description = "Set up Mantine UI";
|
|
4
|
+
const ALL_KEYWORD = "all";
|
|
5
|
+
function builder(yargs) {
|
|
6
|
+
yargs.option("force", {
|
|
7
|
+
alias: "f",
|
|
8
|
+
default: false,
|
|
9
|
+
description: "Overwrite existing configuration",
|
|
10
|
+
type: "boolean"
|
|
11
|
+
});
|
|
12
|
+
yargs.option("install", {
|
|
13
|
+
alias: "i",
|
|
14
|
+
default: true,
|
|
15
|
+
description: "Install packages",
|
|
16
|
+
type: "boolean"
|
|
17
|
+
});
|
|
18
|
+
yargs.option("packages", {
|
|
19
|
+
alias: "p",
|
|
20
|
+
default: ["core", "hooks"],
|
|
21
|
+
description: `Mantine packages to install. Specify '${ALL_KEYWORD}' to install all packages. Default: ['core', 'hooks']`,
|
|
22
|
+
type: "array"
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const handler = createHandler(command);
|
|
26
|
+
export {
|
|
27
|
+
ALL_KEYWORD,
|
|
28
|
+
builder,
|
|
29
|
+
command,
|
|
30
|
+
description,
|
|
31
|
+
handler
|
|
32
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import execa from "execa";
|
|
3
|
+
import fse from "fs-extra";
|
|
4
|
+
import { Listr } from "listr2";
|
|
5
|
+
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
6
|
+
import c from "../../../../lib/colors.js";
|
|
7
|
+
import extendStorybookConfiguration from "../../../../lib/configureStorybook.js";
|
|
8
|
+
import { extendJSXFile, fileIncludes } from "../../../../lib/extendFile.js";
|
|
9
|
+
import { getPaths, writeFile } from "../../../../lib/index.js";
|
|
10
|
+
import { ALL_KEYWORD } from "./mantine.js";
|
|
11
|
+
const ALL_MANTINE_PACKAGES = [
|
|
12
|
+
"core",
|
|
13
|
+
"dates",
|
|
14
|
+
"dropzone",
|
|
15
|
+
"form",
|
|
16
|
+
"hooks",
|
|
17
|
+
"modals",
|
|
18
|
+
"notifications",
|
|
19
|
+
"prism",
|
|
20
|
+
"rte",
|
|
21
|
+
"spotlight"
|
|
22
|
+
];
|
|
23
|
+
const MANTINE_THEME_AND_COMMENTS = `import { createTheme } from '@mantine/core'
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* This object will be used to override Mantine theme defaults.
|
|
27
|
+
* See https://mantine.dev/theming/mantine-provider/#theme-object for theming options
|
|
28
|
+
* @type {import("@mantine/core").MantineThemeOverride}
|
|
29
|
+
*/
|
|
30
|
+
const theme = {}
|
|
31
|
+
|
|
32
|
+
export default createTheme(theme)
|
|
33
|
+
`;
|
|
34
|
+
async function handler({ force, install, packages }) {
|
|
35
|
+
recordTelemetryAttributes({
|
|
36
|
+
command: "setup ui mantine",
|
|
37
|
+
force,
|
|
38
|
+
install,
|
|
39
|
+
packages
|
|
40
|
+
});
|
|
41
|
+
const rwPaths = getPaths();
|
|
42
|
+
const configFilePath = path.join(rwPaths.web.config, "mantine.config.js");
|
|
43
|
+
const installPackages = (packages.includes(ALL_KEYWORD) ? ALL_MANTINE_PACKAGES : packages).map((pack) => `@mantine/${pack}`).concat("postcss", "postcss-preset-mantine", "postcss-simple-vars");
|
|
44
|
+
const tasks = new Listr(
|
|
45
|
+
[
|
|
46
|
+
{
|
|
47
|
+
title: "Installing packages...",
|
|
48
|
+
skip: () => !install,
|
|
49
|
+
task: () => {
|
|
50
|
+
return new Listr(
|
|
51
|
+
[
|
|
52
|
+
{
|
|
53
|
+
title: `Install ${installPackages.join(", ")}`,
|
|
54
|
+
task: async () => {
|
|
55
|
+
await execa("yarn", [
|
|
56
|
+
"workspace",
|
|
57
|
+
"web",
|
|
58
|
+
"add",
|
|
59
|
+
"-D",
|
|
60
|
+
"@emotion/react",
|
|
61
|
+
...installPackages
|
|
62
|
+
]);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
{ rendererOptions: { collapseSubtasks: false } }
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
title: "Setting up Mantine...",
|
|
72
|
+
skip: () => fileIncludes(rwPaths.web.app, "MantineProvider"),
|
|
73
|
+
task: () => extendJSXFile(rwPaths.web.app, {
|
|
74
|
+
insertComponent: {
|
|
75
|
+
name: "MantineProvider",
|
|
76
|
+
props: { theme: "theme" },
|
|
77
|
+
within: "RedwoodProvider"
|
|
78
|
+
},
|
|
79
|
+
imports: [
|
|
80
|
+
"import { MantineProvider } from '@mantine/core'",
|
|
81
|
+
"import theme from 'config/mantine.config'",
|
|
82
|
+
"import '@mantine/core/styles.css'"
|
|
83
|
+
]
|
|
84
|
+
})
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
title: "Configuring PostCSS...",
|
|
88
|
+
task: () => {
|
|
89
|
+
const postCSSConfigPath = rwPaths.web.postcss;
|
|
90
|
+
if (!force && fse.existsSync(postCSSConfigPath)) {
|
|
91
|
+
throw new Error(
|
|
92
|
+
"PostCSS config already exists.\nUse --force to override existing config."
|
|
93
|
+
);
|
|
94
|
+
} else {
|
|
95
|
+
const postCSSConfig = fse.readFileSync(
|
|
96
|
+
path.join(
|
|
97
|
+
import.meta.dirname,
|
|
98
|
+
"../templates/mantine-postcss.config.js.template"
|
|
99
|
+
),
|
|
100
|
+
"utf-8"
|
|
101
|
+
);
|
|
102
|
+
return fse.outputFileSync(postCSSConfigPath, postCSSConfig);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
title: `Creating Theme File...`,
|
|
108
|
+
task: () => {
|
|
109
|
+
writeFile(configFilePath, MANTINE_THEME_AND_COMMENTS, {
|
|
110
|
+
overwriteExisting: force
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
title: "Configure Storybook...",
|
|
116
|
+
skip: () => fileIncludes(rwPaths.web.storybookPreviewConfig, "withMantine"),
|
|
117
|
+
task: async () => await extendStorybookConfiguration(
|
|
118
|
+
path.join(
|
|
119
|
+
import.meta.dirname,
|
|
120
|
+
"..",
|
|
121
|
+
"templates",
|
|
122
|
+
"mantine.storybook.preview.tsx.template"
|
|
123
|
+
)
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
{ rendererOptions: { collapseSubtasks: false } }
|
|
128
|
+
);
|
|
129
|
+
try {
|
|
130
|
+
await tasks.run();
|
|
131
|
+
} catch (e) {
|
|
132
|
+
console.error(c.error(e.message));
|
|
133
|
+
process.exit(e?.exitCode || 1);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
export {
|
|
137
|
+
handler
|
|
138
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createHandler } from "../helpers/helpers.js";
|
|
2
|
+
const command = "tailwindcss";
|
|
3
|
+
const aliases = ["tailwind", "tw"];
|
|
4
|
+
const description = "Set up tailwindcss and PostCSS";
|
|
5
|
+
const builder = (yargs) => {
|
|
6
|
+
yargs.option("force", {
|
|
7
|
+
alias: "f",
|
|
8
|
+
default: false,
|
|
9
|
+
description: "Overwrite existing configuration",
|
|
10
|
+
type: "boolean"
|
|
11
|
+
});
|
|
12
|
+
yargs.option("install", {
|
|
13
|
+
alias: "i",
|
|
14
|
+
default: true,
|
|
15
|
+
description: "Install packages",
|
|
16
|
+
type: "boolean"
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
const handler = createHandler(command);
|
|
20
|
+
export {
|
|
21
|
+
aliases,
|
|
22
|
+
builder,
|
|
23
|
+
command,
|
|
24
|
+
description,
|
|
25
|
+
handler
|
|
26
|
+
};
|