generating-ui-bundle-features
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUI Bundle Features
UI Bundle功能
Installing Pre-built Features
安装预构建功能
Always check for an existing feature before building something from scratch. The features CLI installs pre-built, tested packages into Salesforce UI bundles — from foundational UI libraries (shadcn/ui) to full-stack capabilities (authentication, search, navigation, GraphQL, Agentforce AI).
在从零开始构建功能前,请先检查是否已有现成功能。Features CLI会将经过预构建和测试的包安装到Salesforce UI bundles中——从基础UI库(shadcn/ui)到全栈能力(身份认证、搜索、导航、GraphQL、Agentforce AI)。
Workflow
工作流程
-
Search project code first — checkfor existing implementations before installing anything. Scope searches to
src/to avoid matchingsrc/ornode_modules/.dist/ -
Search available features — usewith
npx @salesforce/ui-bundle-features listto filter by keyword. Use--search <query>for full descriptions.--verbose -
Describe a feature — useto see components, dependencies, copy operations, and example files.
npx @salesforce/ui-bundle-features describe <feature> -
Install — use. Key options:
npx @salesforce/ui-bundle-features install <feature> --ui-bundle-dir <name>- to preview changes
--dry-run - for non-interactive mode (skips conflicts)
--yes - to detect conflicts, then
--on-conflict errorto resolve them--conflict-resolution <file>
If no matching feature is found, ask the user before building a custom implementation — a relevant feature may exist under a different name.
-
先搜索项目代码——在安装任何内容前,检查目录是否已有现成实现。将搜索范围限定在
src/,避免匹配src/或node_modules/目录。dist/ -
搜索可用功能——使用命令并加上
npx @salesforce/ui-bundle-features list参数按关键词筛选。使用--search <query>参数查看完整描述。--verbose -
查看功能详情——使用命令查看组件、依赖项、复制操作及示例文件。
npx @salesforce/ui-bundle-features describe <feature> -
安装功能——使用命令。关键选项:
npx @salesforce/ui-bundle-features install <feature> --ui-bundle-dir <name>- :预览变更
--dry-run - :非交互模式(跳过冲突提示)
--yes - :检测冲突,随后使用
--on-conflict error解决冲突--conflict-resolution <file>
如果未找到匹配功能,请先询问用户再构建自定义实现——相关功能可能以其他名称存在。
Conflict Handling
冲突处理
In non-interactive environments, use the two-pass approach: first run with to detect conflicts, then create a resolution JSON file () and re-run with .
--on-conflict error{ "path": "skip" | "overwrite" }--conflict-resolution在非交互环境中,采用两步法:先运行带参数的命令检测冲突,然后创建一个解析JSON文件(格式为),再运行带参数的命令重新执行。
--on-conflict error{ "path": "skip" | "overwrite" }--conflict-resolutionPost-install: Integrating Example Files
安装后:集成示例文件
Features may include files showing integration patterns. For each:
__example__- Read the example file to understand the pattern
- Read the target file (shown in output)
describe - Apply the pattern from the example into the target
- Delete the example file after successful integration
功能可能包含文件,展示集成模式。针对每个示例文件:
__example__- 阅读示例文件以理解集成模式
- 阅读输出中显示的目标文件
describe - 将示例中的模式应用到目标文件中
- 成功集成后删除示例文件
Hint Placeholders
提示占位符
Some copy paths use placeholders (e.g., ) that the CLI does not resolve. After installation, rename or relocate these files to the intended target, or integrate their patterns into an existing file.
<descriptive-name><desired-page-with-search-input>部分复制路径使用占位符(例如),CLI不会自动解析这些占位符。安装完成后,请将这些文件重命名或移动到预期目标位置,或将其模式集成到现有文件中。
<descriptive-name><desired-page-with-search-input>