From 4b2a90ccfeeed79eb60e35f97b191b5733c66ade Mon Sep 17 00:00:00 2001 From: gitee-bot Date: Mon, 7 Jul 2025 02:19:15 +0000 Subject: [PATCH] Update README.md --- README.md | 66 ++++++++++++++++++++----------------------------------- 1 file changed, 24 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index fd43dc6..56709f9 100644 --- a/README.md +++ b/README.md @@ -1,69 +1,51 @@ # @halo-dev/theme-package-cli -A command-line tool for packaging Halo theme template files, making them ready for distribution. +`@halo-dev/theme-package-cli` 是一个用于打包 Halo 主题的命令行工具。它可以帮助开发者将主题项目中的必要文件进行打包,以便于部署或分发。 -## Features +## 特性 -- Package Halo theme template files into a ZIP file -- Option to package all files or only essential files +- 支持全局和本地安装。 +- 可选择仅打包必要文件或所有文件(排除 `node_modules`、`dist` 等目录)。 +- 自动识别并处理 `.gitignore` 中定义的忽略规则。 -## Installation +## 安装 -### Global Installation +### 全局安装 ```bash -npm install -g @halo-dev/theme-package-cli - -# or - -npx @halo-dev/theme-package-cli +pnpm add -g @halo-dev/theme-package-cli ``` -### Local Installation +### 本地安装 ```bash -npm install @halo-dev/theme-package-cli +pnpm add -D @halo-dev/theme-package-cli ``` -## Usage +## 使用 -Run the command in your Halo theme project root directory: +### 仅打包必要文件(模板、README.md、*.yaml/*.yml、i18n、LICENSE) ```bash -# Only package essential files (templates, README.md, *.yaml/*.yml, i18n, LICENSE) theme-package +``` -# Package all files (excluding node_modules, dist, etc.) +### 打包所有文件(排除 node_modules、dist 等) + +```bash theme-package --all -# or -theme-package -a ``` -### Packaging Rules - -- By default, only packages essential files and directories: - - templates directory - - README.md - - All .yaml and .yml files - - i18n directory - - LICENSE file +## 打包规则 -- When using the `--all` parameter, packages all files in the project, excluding: - - node_modules directory - - dist directory - - .git directory - - .github directory - - .idea directory - - .vscode directory - - .husky directory - - Lock files (pnpm-lock.yaml, package-lock.json, yarn.lock, bun.lockb) - - .DS_Store files +- 默认情况下,工具会根据 `.gitignore` 文件中的规则排除不需要打包的文件。 +- 如果未提供 `.gitignore` 文件,则使用默认规则排除常见不需要的目录和文件。 -## Requirements +## 要求 -- Node.js environment -- The theme project root directory must contain a properly formatted theme.yaml file +- Node.js >= 14.x +- pnpm >= 6.x -## License +## 许可证 -MIT +MIT License. See [LICENSE](LICENSE) for details. \ No newline at end of file -- Gitee