Skip to content

Add project scaffolding as Wasp CLI command #3308

@infomiho

Description

@infomiho

The idea is to offer a way for users to quickly add pieces of functionality to their apps via the Wasp CLI.

For example, if they wanted to enable auth they would run one command which would add auth to the Wasp file + create auth routes and pages the user might need.

Some examples in other projects:

  • Astro e.g. npx astro add react
  • Laravel e.g. php artisan make:model Flight --migration

One possible way to implement it

The idea can be summed up in these made up examples:

wasp add

Lists out the available recipes and the user chooses.

$ wasp add
What are we adding today? 🪄
- Tailwind
- Auth
- Email sending
- Async Jobs
...

wasp add tailwind

User knows upfront which action they want.

$ wasp add tailwind
Okay, adding Tailwind ✨
- creating tailwind.config.cjs
- creating postcss.config.cjs

To complete adding Tailwind to your project,
add this to your main CSS file:

@tailwind base;
@tailwind components;
@tailwind utilities;

wasp add auth

Some of the recipes will require extra questions.

$ wasp add auth
Which auth do we you want to add?
- Email ✅
- Username & password
- Google
- Github

Are you using Typescript?
- Yes ✅
- Hell no

Okay, adding Email auth ✨
- creating client/pages/LoginPage.tsx
- creating client/pages/SignupPage.tsx
- creating client/pages/EmailVerifyPage.tsx
- creating client/pages/ForgotPasswordPage.tsx
- creating client/pages/ResetPasswordPage.tsx
- appending to .env.server
- updating the Wasp file

Your email auth is enabled. If you want to protect a page,
add `authRequired: true` to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions