add-feature

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

add-feature

添加功能

Add Wasp's batteries-included features to your app. Each invocation focuses on one feature at a time.
为你的应用添加Wasp的开箱即用功能。每次操作仅专注于一个功能。

Before Starting

开始之前

  1. Verify user is in the app directory (check for wasp config file:
    main.wasp
    or
    main.wasp.ts
    )
  1. 确认用户处于应用目录中(检查是否存在Wasp配置文件:
    main.wasp
    main.wasp.ts

Available Wasp Features

可用的Wasp功能

Present these features to the user and let them choose ONE to configure:
FeatureDescription
App BrandingSet your app's name, description, and meta tags
AuthenticationAdd login methods (Email, Google, GitHub, etc.)
Email ProviderConfigure email sending (SendGrid, Mailgun, etc.)
DatabaseSet up your database (PostgreSQL, SQLite, etc.)
Styling (CSS, UI)Add Tailwind CSS or ShadCN UI (on top of Tailwind CSS)
向用户展示这些功能,并让他们选择一个进行配置:
功能描述
应用品牌设置设置应用的名称、描述和元标签
认证功能添加登录方式(邮箱、Google、GitHub等)
邮件提供商配置邮件发送功能(SendGrid、Mailgun等)
数据库设置数据库(PostgreSQL、SQLite等)
样式(CSS、UI)添加Tailwind CSS或ShadCN UI(基于Tailwind CSS)

Feature Selection

功能选择

Using the
AskUserQuestion
tool, ask the user which Wasp feature they'd like to configure:
  • Use the most relevant options as selectable choices (limited to 2-4 options)
  • Remind users they can select "Other" to choose from additional features
使用
AskUserQuestion
工具,询问用户想要配置哪个Wasp功能:
  • 选择最相关的选项作为可选项(限制为2-4个)
  • 提醒用户可以选择“其他”来挑选更多功能

Execute Selected Feature

执行所选功能

Based on the user's selection, follow the corresponding guides below. ALWAYS follow the feature guide's corresponding raw text documentation URLs and use it as the basis for assisting the user.
  • App Brandingapp-branding.md
  • Authenticationauthentication.md
  • Email Provideremail-provider.md
  • Databasedatabase.md
  • Styling (CSS, UI)styling.md
根据用户的选择,按照以下对应的指南操作。务必遵循功能指南对应的原始文本文档URL,并以此为基础协助用户。
  • 应用品牌设置app-branding.md
  • 认证功能authentication.md
  • 邮件提供商email-provider.md
  • 数据库database.md
  • 样式(CSS、UI)styling.md

Guidelines for Using AskUserQuestion with Lists

使用AskUserQuestion处理列表的指南

When asking the user to choose from fetched lists (e.g., auth methods, email providers):
  1. Always display the full list to the user before asking them to choose, so they know all available options.
  2. Use the most popular/common options as the selectable choices in
    AskUserQuestion
    (limited to 2-4 options).
  3. Remind users they can select "Other" to specify any option from the full list that isn't shown in the quick-select options.
  4. Example format:
    Available auth methods: Username & Password, Email, Google, GitHub, Discord, Keycloak, Slack
    
    [AskUserQuestion with 3-4 most common options]
    
    Note: Select "Other" to choose from additional options like Discord, Keycloak, or Slack.
当让用户从获取的列表中选择时(如认证方式、邮件提供商):
  1. 始终先展示完整列表给用户,再让他们选择,确保他们了解所有可用选项。
  2. 选择最受欢迎/常用的选项作为
    AskUserQuestion
    中的可选项(限制为2-4个)。
  3. 提醒用户可以选择“其他”来指定完整列表中未在快速选择选项里显示的任何选项。
  4. 示例格式:
    Available auth methods: Username & Password, Email, Google, GitHub, Discord, Keycloak, Slack
    
    [AskUserQuestion with 3-4 most common options]
    
    Note: Select "Other" to choose from additional options like Discord, Keycloak, or Slack.

After Feature Completion

功能配置完成后

After completing a feature configuration:
  1. Summarize the changes made
  2. If applicable, let them know if there are any environment variables they need to set and ask them if they need guidance on how to set them
  • if so, fetch the raw github doc file URL for the environment variables and guide the user through the process
  1. Ask if the user would like to configure another feature
  2. If yes, return to Feature Selection
完成功能配置后:
  1. 总结所做的更改
  2. 如有需要,告知用户是否需要设置环境变量,并询问他们是否需要设置指导
  • 如果需要,获取环境变量对应的GitHub原始文档URL,并引导用户完成设置过程
  1. 询问用户是否想要配置其他功能
  2. 如果是,返回功能选择