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. 示例格式:
    可用的身份验证方式:用户名密码、邮箱、Google、GitHub、Discord、Keycloak、Slack
    
    [使用3-4个最常用选项的AskUserQuestion]
    
    注意:选择“其他”可选择Discord、Keycloak或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. 如果是,返回功能选择