# @sun-dock/dock-cli

> ```bash pnpm i @sun-dock/dock-cli -D ```

Latest version **1.0.6** (published 2023-03-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install @sun-dock/dock-cli
pnpm add @sun-dock/dock-cli
yarn add @sun-dock/dock-cli
bun add @sun-dock/dock-cli
```

Provides the command `dock`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2023-03-10 |
| First published | 2023-03-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 2.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | mapinxue |

## Links

- npm: https://www.npmjs.com/package/@sun-dock/dock-cli
- npm.io page: https://npm.io/package/@sun-dock/dock-cli

## Dependencies (2)

- [minimist](https://npm.io/package/minimist.md) ^1.2.8
- [@sun-dock/core](https://npm.io/package/@sun-dock/core.md) 1.0.5

## Recent versions

- 1.0.6 (latest) — 2023-03-10
- 1.0.5 — 2023-03-06
- 1.0.4 — 2023-03-06
- 1.0.3 — 2023-03-06
- 1.0.2 — 2023-03-03
- 1.0.1 — 2023-03-03
- 1.0.0 — 2023-03-03

## README

# Dock-Cli

```bash
pnpm i @sun-dock/dock-cli -D
```

将相应的命令添加到 `package.json` 中，⚠️注意 `bin.name` 是 dock:

```json
"scripts": {
    "dock": "dock"
}
```

## 查询 windicss class
你甚至可以建个空项目只为了快速查询 windicss class，或者将 dock-cli 安装到全局下直接使用查询。

使用`--query`参数通过以下命令查询:
```bash
pnpm run dock --query=padding:4,paddingTop:4,textAlign:\"center\" # 注意不要有空格
# The input style pair "padding:4,paddingTop:4,textAlign:"center"" will tranform like this: 
# <div className="p-4px pt-4px text-center" />;
```
可以看到 dock-cli 打印了一个 JSX，其中就包含了生成的所有 class，不再需要搜索直接 一步到位。

## 对单个文件转换
使用`--filename`对单个文件进行转换：
```bash
pnpm run dock --filename=Hello.tsx
```
**为什么不支持批量修改？**

考虑到可能出现的 bug 影响布局当时没发现但导致线上缺陷，所以提供单文件原子化修改，单功能验证避免**大规模纰漏**。

> 你也可以在本地写脚本遍历文件夹，再在单文件上使用 dock-cli

---
_Source: https://npm.io/package/@sun-dock/dock-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
