Skip to content

Commit d878fc3

Browse files
committed
chore: format tailwindcss-patch
1 parent b96063b commit d878fc3

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

packages/tailwindcss-patch/README-cn.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ CLI 会通过 `@tailwindcss-mangle/config` 加载 `tailwindcss-patch.config.ts`
5353

5454
### `tokens` 常用参数
5555

56-
| 参数 | 说明 |
57-
| ------------------------ | ----------------------------------------------- |
58-
| `--cwd <dir>` | 指定扫描时使用的工作目录。 |
59-
| `--output <file>` | 覆盖输出文件路径(默认 `.tw-patch/tw-token-report.json`)。 |
60-
| `--format <json\|lines\|grouped-json>` | 选择 JSON(默认)、按行输出,或按文件路径分组的 JSON。 |
61-
| `--group-key <relative\|absolute>` | 分组 JSON 的键(默认使用相对路径)。 |
62-
| `--no-write` | 只打印预览,不写入磁盘。 |
56+
| 参数 | 说明 |
57+
| -------------------------------------- | ----------------------------------------------------------- |
58+
| `--cwd <dir>` | 指定扫描时使用的工作目录。 |
59+
| `--output <file>` | 覆盖输出文件路径(默认 `.tw-patch/tw-token-report.json`)。 |
60+
| `--format <json\|lines\|grouped-json>` | 选择 JSON(默认)、按行输出,或按文件路径分组的 JSON。 |
61+
| `--group-key <relative\|absolute>` | 分组 JSON 的键(默认使用相对路径)。 |
62+
| `--no-write` | 只打印预览,不写入磁盘。 |
6363

6464
## 编程接口
6565

packages/tailwindcss-patch/README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ cli.help()
5959
cli.parse()
6060
```
6161

62-
6362
#### Custom command hooks
6463

6564
Hosts can override per-command lifecycles by supplying `commandHandlers`. Each handler receives a context object (with the resolved `cwd`, parsed `args`, memoized `loadConfig`/`createPatcher` helpers, and the shared `logger`) plus a `next()` callback that runs the built-in action.
@@ -94,7 +93,6 @@ mountTailwindcssPatchCommands(cli, {
9493

9594
Skip `next()` to fully replace a command (e.g. custom `init` or cache clearing before `install`). Calling `next()` returns the default result—`ExtractResult`, `TailwindTokenReport`, etc.—so hosts can log metadata or feed it into their own telemetry without re-implementing the commands.
9695

97-
9896
### Extract options
9997

10098
| Flag | Description |
@@ -109,13 +107,13 @@ The CLI loads `tailwindcss-patch.config.ts` via `@tailwindcss-mangle/config`. Le
109107

110108
### Token report options
111109

112-
| Flag | Description |
113-
| ------------------------ | --------------------------------------------------------------------------- |
114-
| `--cwd <dir>` | Use a different working directory when loading configuration. |
115-
| `--output <file>` | Override the token report target file (defaults to `.tw-patch/tw-token-report.json`). |
110+
| Flag | Description |
111+
| -------------------------------------- | ----------------------------------------------------------------------------------------- |
112+
| `--cwd <dir>` | Use a different working directory when loading configuration. |
113+
| `--output <file>` | Override the token report target file (defaults to `.tw-patch/tw-token-report.json`). |
116114
| `--format <json\|lines\|grouped-json>` | Choose between a JSON payload (default), newline summaries, or JSON grouped by file path. |
117-
| `--group-key <relative\|absolute>` | Control grouped-json keys (defaults to relative paths). |
118-
| `--no-write` | Skip writing to disk and only print a preview. |
115+
| `--group-key <relative\|absolute>` | Control grouped-json keys (defaults to relative paths). |
116+
| `--no-write` | Skip writing to disk and only print a preview. |
119117

120118
## Programmatic API
121119

packages/tailwindcss-patch/src/cli/commands.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { CAC, Command, OptionConfig } from 'cac'
1+
import type { CAC, Command } from 'cac'
22
import type { LegacyTailwindcssPatcherOptions } from '../options/legacy'
33
import type {
44
ExtractResult,
@@ -26,11 +26,12 @@ export const tailwindcssPatchCommands: TailwindcssPatchCommand[] = ['install', '
2626

2727
type TokenOutputFormat = 'json' | 'lines' | 'grouped-json'
2828
type TokenGroupKey = 'relative' | 'absolute'
29+
type CacOptionConfig = Parameters<Command['option']>[2]
2930

3031
export interface TailwindcssPatchCommandOptionDefinition {
3132
flags: string
3233
description?: string
33-
config?: OptionConfig
34+
config?: CacOptionConfig
3435
}
3536

3637
export interface TailwindcssPatchCommandOptions {

0 commit comments

Comments
 (0)