放大CLI
在Drupal,WordPress,或独立前端构建和使用组件系统.
所需资源
乳化CLI需要节点.js 24或更新.
安装
从全球安装 Eulsify CLI 无数字 :
npm install -g @emulsify/cli
随时运行当前命令帮助 :
emulsify
emulsify --help
快速启动
创建 Drupal 启动项目,安装一个系统,并添加组件 :
emulsify init "My Theme" ./web/themes/custom --platform drupal
cd ./web/themes/custom/my_theme
emulsify system install
emulsify component list
emulsify component install card
emulsify component create promo-card --directory molecules --type twig
内建平台为 drupal, (中文(简体) ), wordpress,以及 none。对于 WordPress 儿童主题,请使用 WordPress 平台和启动器:
emulsify init "My Theme" ./wp-content/themes --platform wordpress
WordPress自动被检测时,Emulsify将孩子主题初始化为被检测的主题目录,例如: wp-content/themes/my-theme 或者说 web/app/themes/my-theme 为贝德洛克.
创建独立、可分配组件系统,运行 system create
任何项目之外或内部。 目标目录创建于
选中的父目录 :
emulsify system create "My System" --directory ./systems --platform "drupal || wordpress" --git
这创造了 ./systems/my-system 具有有效系统和可变配置,
可安装 example-card 储存库文件,a
.gitignore,并有一个许可证占地者在分发前替换.
除非被推翻,否则其所需的URL元数据将使用明显的、有计划的验证
https://TODO.invalid/... 占位符,必须在
出版.
添加 --dry-run 以预览规范的目标,每个生成的文件,以及
git 是否在不更改文件系统的情况下初始化 .
当从另一个系统安装的组件演变成 在创建替换前拆卸已配置的系统 :
emulsify system detach
调试只删除 system 财务报告和审定财务报表 variant 来自
project.emulsify.json. 部件、项目资产和缓存系统
仓库留在原地。 运行 system create 脚手架 新系统
存储器,然后移动或复制保存的组件到脚手架和
更新 system.emulsify.json· ; system create 不导入
自动.
交互式终端可以运行 emulsify component create 没有参数
通过组件名称、类型和目录提示。 类型拾取器
总是提供Twig, 提供Twig SDC 在 Drupal 项目, 并提供 React and Web
项目时的组件脚手架 package.json 声明
@emulsify/core当无法选择时,向导解释原因
Twig是唯一合适的选择,它跳过了单项提示. 同样,
emulsify component install 没有名称显示可用的组件
已安装的系统变体加上安装所有组件的明确选择.
要定制组件脚手架,请将 CLI 的内置模板复制到
工程,然后编辑由此产生的文件 .cli/templates/数字 :
emulsify component eject-templates twig
在交互式终端中运行没有类型的命令以选择一个或多个
组件类型。 使用 --all 以非交互方式弹出每个类型。 现有
除非 --force 通过.
提示仅在标准输入为 TTY 时运行 。 在CI中,脚本和命令 管道或重定向输入,提供所需要所有位置参数和标志; cLI 以可操作错误退出, 而不是等待输入 :
emulsify init "My Theme" ./web/themes/custom --platform drupal --yes
emulsify system create my-system --directory ./systems --platform none --git
emulsify system create my-system --directory ./systems --platform none --git --dry-run
emulsify system install compound
emulsify component install card --force
# Or install every available component:
emulsify component install --all
emulsify component create promo-card --directory molecules --type twig --force
emulsify component create card --directory molecules --type web-component --tag-name acme-card
emulsify component eject-templates --all
emulsify system detach --yes
对于组件安装,请提供组件名称或 --all,并使用
--force 应替换现有目的地。 构成部分
创建, 提供位置名称加 --type 财务报告和审定财务报表 --directory,并使用
--force 用于替换已生成组件。 现有
-y, --yes 表格仍可作为兼容性别名。 明确
--type 即使项目检测会隐藏选择, 值也会被尊重
从巫师。 堕落者 --format default 财务报告和审定财务报表 --format sdc 表单
仍作为别名可供使用 --type twig 财务报告和审定财务报表 --type twig-sdc, (中文(简体) ),
并分别打印去色警告. Web 组件获得其标记
从组件名称和项目名称; 通过 --tag-name 来推翻它,
,包括在非交互运行中导出值无效时.
对于模板弹出,请提供组件类型或 --all tTY 外部; 使用
--dry-run 预览路径和 --force 仅在已有定制时
应替换.
文档
详细文件 文档。 。 。 .
| 专题 | 使用此选项时 |
|---|---|
| CLI 参考 | 查找命令、别名、选项和示例. |
| 项目初始化 | 从启动器创建新的 Emulsify 项目 . |
| 系统 | 列出、安装、分解或编写组件系统. |
| 构成部分 | 列出、安装、干燥或创建组件. |
| 项目配置 | 谅解 project.emulsify.json,变体,和结构映射. |
| 组件模板覆盖 | 弹出和自定义所使用的文件 emulsify component create。 。 。 . |
| 钩子 还有缓存 | 了解启动钩,系统钩,以及本地寄存器缓存行为. |
| 发展 | 建立这个寄存器并运行本地检查. |
| 释放 | 理解CI,语义释出,和npm出版. |
命令概览
| 命令 | 别名 | 说明 |
|---|---|---|
emulsify init [name] [path] | 从启动器初始化一个 Emulsify 项目 . | |
emulsify audit [...args] | 运行已安装的项目 Emulsify 核心审计. | |
emulsify system list | emulsify system ls | 列出可供安装的内置系统. |
emulsify system create [name] | 创建一个独立的组件系统寄存器. | |
emulsify system install [name] | 在当前 Emulsify 项目中安装一个系统. | |
emulsify system detach | 解开系统并保留项目组件. | |
emulsify component list | emulsify component ls | 列出从已安装的系统和变体中可用的组件. |
emulsify component install [name] | emulsify component i [name] | 从已安装的系统和变体安装一个组件. |
emulsify component create [name] | emulsify component c [name] | 在当前 Emulsify 项目中创建本地组件. |
emulsify component eject-templates [type] | 将可编辑的内置模板写入当前工程. | |
emulsify cache clear | 清除本地缓存系统仓库 . |
emulsify audit 是一个方便的外表。 项目安装
@emulsify/core 软件包仍然是条子的主人 emulsify-audit
机器接口 检查 发现 JSON 计划 输出和退出行为.
见 CLI 参考 财务报告和审定财务报表
核心审计文件。 。 。 .
贡献者
见 贡献者。 。 。 .