| Crates.io | femaker |
| lib.rs | femaker |
| version | 0.1.3 |
| created_at | 2023-09-22 16:58:11.033712+00 |
| updated_at | 2025-08-25 14:55:01.014811+00 |
| description | 简单优雅的前端脚手架 |
| homepage | |
| repository | |
| max_upload_size | |
| id | 980710 |
| size | 75,224 |
FeMaker 是一个使用 Rust 开发的现代化前端脚手架工具,专为提升前端开发效率而设计。它提供了项目模板管理、快速项目初始化和自动化部署等功能。
cargo install femaker
安装完成后,确保 Rust 的二进制目录在你的 PATH 中:
# Bash 用户
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
# Zsh 用户
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
# 验证安装
femaker --version
使用 femaker new 命令快速创建新项目:
femaker new my-project
执行后会出现交互式选择界面:
femaker v0.1.2
✔ 请选择模版类型 · 项目
✔ 请选择模板 · vite-antd-pc 管理后台
正在下载模版...
项目初始化完成!
# 1. 创建项目
femaker new my-project
# 2. 进入项目目录
cd my-project
# 3. 初始化 Git 仓库(可选)
git init
git add .
git commit -m "feat: initial commit"
# 4. 关联远程仓库(可选)
git branch -M main
git remote add origin https://github.com/username/my-project.git
git push -u origin main
femaker new <project-name>创建新项目,支持多种模板类型:
femaker list查看所有可用的模板列表:
femaker list
# 输出示例:
【项目】vite-antd-pc 管理后台
【项目】next-antd-pc 管理后台
【项目】vite h5 基建项目模板
【组件】react 组件库
【其他】css 库
【其他】基于rollup + typescript 封装常用的工具函数
femaker add添加自定义模板到脚手架(仅支持 Git 仓库):
femaker add
# 交互式添加流程:
✔ 请选择模版类型 · 项目
请填写模版名称: 我的自定义模板
请填写模版git地址: https://github.com/username/my-template.git
模板添加成功!
femaker deploy自动化部署功能,支持多环境配置(建议仅用于开发/测试环境)。
在项目根目录创建 deploy.config.json 文件:
[
{
"name": "开发环境",
"server_address": "your-server:22",
"username": "your-username",
"password": "your-password",
"local_dir": "./dist",
"remote_dir": "/var/www/html"
},
{
"name": "测试环境",
"server_address": "test-server:22",
"username": "your-username",
"password": "your-password",
"local_dir": "./dist",
"remote_dir": "/var/www/test"
}
]
femaker deploy
# 交互式选择部署环境:
✔ 请选择部署环境 · 测试环境
开始部署...
创建远程目录: "/var/www/test"
上传文件: "/var/www/test/index.html"
上传文件: "/var/www/test/assets/main.js"
部署成功!
⚠️ 安全提示: 部署功能建议仅在开发和测试环境使用,生产环境建议使用更安全的 CI/CD 流程。
FeMaker 基于以下技术构建:
# 克隆项目
git clone https://github.com/luozyiii/femaker-cli.git
cd femaker-cli
# 构建项目
cargo build
# 运行测试
cargo test
# 本地安装
cargo install --path .
项目使用 rustfmt 进行代码格式化,建议配置 VS Code:
// .vscode/settings.json
{
"[rust]": {
"editor.defaultFormatter": "statiolake.vscode-rustfmt",
"editor.formatOnSave": true,
"editor.tabSize": 4
}
}
# 1. 登录 crates.io (需要先在 https://crates.io/settings/tokens 获取 token)
cargo login <your-token>
# 2. 构建项目
cargo build --release
# 3. 生成文档
cargo doc --no-deps
# 4. 发布到 crates.io
cargo publish
欢迎提交 Issue 和 Pull Request!
本项目基于 MIT 许可证 开源。
如果 FeMaker 对你有帮助,请给个 ⭐️ 支持一下!